Skip to content

Commit 7b5611f

Browse files
committed
chore(sync): apply remaining canonical fleet drift fixes
1 parent 01b7781 commit 7b5611f

4 files changed

Lines changed: 39 additions & 6 deletions

File tree

.config/oxfmtrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
"**/scripts/ai-lint-fix.mts",
6565
"**/scripts/ai-lint-fix/cli.mts",
6666
"**/scripts/ai-lint-fix/rule-guidance.mts",
67+
"**/scripts/check-lock-step-header.mts",
68+
"**/scripts/check-lock-step-refs.mts",
6769
"**/scripts/check-paths.mts",
6870
"**/scripts/check-paths/allowlist.mts",
6971
"**/scripts/check-paths/cli.mts",
@@ -97,6 +99,8 @@
9799
"**/scripts/security.mts",
98100
"**/scripts/socket-wheelhouse-emit-schema.mts",
99101
"**/scripts/socket-wheelhouse-schema.mts",
102+
"**/scripts/test/check-lock-step-header.test.mts",
103+
"**/scripts/test/check-lock-step-refs.test.mts",
100104
"**/scripts/test/install-git-hooks.test.mts",
101105
"**/scripts/update.mts",
102106
"**/scripts/validate-bundle-deps.mts",

.config/oxlintrc.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
3-
"plugins": ["typescript", "unicorn", "import"],
4-
"jsPlugins": ["./oxlint-plugin/index.mts"],
3+
"plugins": [
4+
"typescript",
5+
"unicorn",
6+
"import"
7+
],
8+
"jsPlugins": [
9+
"./oxlint-plugin/index.mts"
10+
],
511
"categories": {
612
"correctness": "error",
713
"suspicious": "error"
814
},
915
"rules": {
10-
"eslint/curly": ["error", "all"],
16+
"eslint/curly": [
17+
"error",
18+
"all"
19+
],
1120
"eslint/no-await-in-loop": "off",
1221
"eslint/no-console": "off",
1322
"eslint/no-control-regex": "off",
@@ -18,9 +27,9 @@
1827
}
1928
],
2029
"eslint/no-new": "error",
21-
"eslint/no-underscore-dangle": "off",
2230
"eslint/no-proto": "error",
2331
"eslint/no-shadow": "off",
32+
"eslint/no-underscore-dangle": "off",
2433
"eslint/no-unmodified-loop-condition": "off",
2534
"eslint/no-unused-vars": "off",
2635
"eslint/no-useless-catch": "off",
@@ -41,6 +50,7 @@
4150
"socket/no-default-export": "error",
4251
"socket/no-dynamic-import-outside-bundle": "error",
4352
"socket/no-fetch-prefer-http-request": "error",
53+
"socket/no-file-scope-oxlint-disable": "error",
4454
"socket/no-inline-logger": "error",
4555
"socket/no-logger-newline-literal": "error",
4656
"socket/no-npx-dlx": "error",
@@ -155,6 +165,8 @@
155165
"**/scripts/ai-lint-fix.mts",
156166
"**/scripts/ai-lint-fix/cli.mts",
157167
"**/scripts/ai-lint-fix/rule-guidance.mts",
168+
"**/scripts/check-lock-step-header.mts",
169+
"**/scripts/check-lock-step-refs.mts",
158170
"**/scripts/check-paths.mts",
159171
"**/scripts/check-paths/allowlist.mts",
160172
"**/scripts/check-paths/cli.mts",
@@ -188,6 +200,8 @@
188200
"**/scripts/security.mts",
189201
"**/scripts/socket-wheelhouse-emit-schema.mts",
190202
"**/scripts/socket-wheelhouse-schema.mts",
203+
"**/scripts/test/check-lock-step-header.test.mts",
204+
"**/scripts/test/check-lock-step-refs.test.mts",
191205
"**/scripts/test/install-git-hooks.test.mts",
192206
"**/scripts/update.mts",
193207
"**/scripts/validate-bundle-deps.mts",

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@
114114
.claude/hooks/judgment-reminder/package.json linguist-generated=true
115115
.claude/hooks/judgment-reminder/test/index.test.mts linguist-generated=true
116116
.claude/hooks/judgment-reminder/tsconfig.json linguist-generated=true
117+
.claude/hooks/lock-step-ref-guard/README.md linguist-generated=true
118+
.claude/hooks/lock-step-ref-guard/index.mts linguist-generated=true
119+
.claude/hooks/lock-step-ref-guard/package.json linguist-generated=true
120+
.claude/hooks/lock-step-ref-guard/test/index.test.mts linguist-generated=true
121+
.claude/hooks/lock-step-ref-guard/tsconfig.json linguist-generated=true
117122
.claude/hooks/logger-guard/README.md linguist-generated=true
118123
.claude/hooks/logger-guard/index.mts linguist-generated=true
119124
.claude/hooks/logger-guard/package.json linguist-generated=true
@@ -144,6 +149,10 @@
144149
.claude/hooks/no-external-issue-ref-guard/package.json linguist-generated=true
145150
.claude/hooks/no-external-issue-ref-guard/test/index.test.mts linguist-generated=true
146151
.claude/hooks/no-external-issue-ref-guard/tsconfig.json linguist-generated=true
152+
.claude/hooks/no-file-scope-oxlint-disable-guard/README.md linguist-generated=true
153+
.claude/hooks/no-file-scope-oxlint-disable-guard/index.mts linguist-generated=true
154+
.claude/hooks/no-file-scope-oxlint-disable-guard/package.json linguist-generated=true
155+
.claude/hooks/no-file-scope-oxlint-disable-guard/tsconfig.json linguist-generated=true
147156
.claude/hooks/no-fleet-fork-guard/README.md linguist-generated=true
148157
.claude/hooks/no-fleet-fork-guard/index.mts linguist-generated=true
149158
.claude/hooks/no-fleet-fork-guard/package.json linguist-generated=true
@@ -328,6 +337,7 @@
328337
.config/oxlint-plugin/rules/no-default-export.mts linguist-generated=true
329338
.config/oxlint-plugin/rules/no-dynamic-import-outside-bundle.mts linguist-generated=true
330339
.config/oxlint-plugin/rules/no-fetch-prefer-http-request.mts linguist-generated=true
340+
.config/oxlint-plugin/rules/no-file-scope-oxlint-disable.mts linguist-generated=true
331341
.config/oxlint-plugin/rules/no-inline-logger.mts linguist-generated=true
332342
.config/oxlint-plugin/rules/no-logger-newline-literal.mts linguist-generated=true
333343
.config/oxlint-plugin/rules/no-npx-dlx.mts linguist-generated=true
@@ -453,6 +463,8 @@ packages/build-infra/release-assets.schema.json linguist-generated=true
453463
scripts/ai-lint-fix.mts linguist-generated=true
454464
scripts/ai-lint-fix/cli.mts linguist-generated=true
455465
scripts/ai-lint-fix/rule-guidance.mts linguist-generated=true
466+
scripts/check-lock-step-header.mts linguist-generated=true
467+
scripts/check-lock-step-refs.mts linguist-generated=true
456468
scripts/check-paths.mts linguist-generated=true
457469
scripts/check-paths/allowlist.mts linguist-generated=true
458470
scripts/check-paths/cli.mts linguist-generated=true
@@ -486,6 +498,8 @@ scripts/power-state.mts linguist-generated=true
486498
scripts/security.mts linguist-generated=true
487499
scripts/socket-wheelhouse-emit-schema.mts linguist-generated=true
488500
scripts/socket-wheelhouse-schema.mts linguist-generated=true
501+
scripts/test/check-lock-step-header.test.mts linguist-generated=true
502+
scripts/test/check-lock-step-refs.test.mts linguist-generated=true
489503
scripts/test/install-git-hooks.test.mts linguist-generated=true
490504
scripts/update.mts linguist-generated=true
491505
scripts/validate-bundle-deps.mts linguist-generated=true

CLAUDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Apply in: worktree creation, base-ref resolution for `git diff`/`git rev-list`,
6969

7070
### Claude Code plugin pins
7171

72-
🚨 Fleet-blessed Claude Code plugins are SHA-pinned in the wheelhouse-canonical [`.claude-plugin/marketplace.json`](../.claude-plugin/marketplace.json), with companion human-readable metadata (pin date, pinner) in [`.claude-plugin/README.md`](../.claude-plugin/README.md). The pair is enforced together: every `plugins[].source.sha` in `marketplace.json` must have a row in the README table with matching `version` + `sha` + an ISO-8601 `date`. Same staleness signal the GHA `uses:` SHA-pin comments carry. Bump the SHA → bump the row. Run `pnpm run install-claude-plugins` to reconcile a machine to the pinned set; the script also merges `env.CODEX_TRUSTED_ENV_PARENTS` into `~/.claude/settings.json` so the upstream codex plugin honors `~/.claude/session-env/` as a trusted env-file parent (enforced by `.claude/hooks/marketplace-comment-guard/`).
72+
🚨 Fleet-blessed Claude Code plugins are SHA-pinned in the wheelhouse-canonical [`.claude-plugin/marketplace.json`](../.claude-plugin/marketplace.json), with companion human-readable metadata (pin date, pinner) in [`.claude-plugin/README.md`](../.claude-plugin/README.md). The pair is enforced together: every `plugins[].source.sha` in `marketplace.json` must have a row in the README table with matching `version` + `sha` + an ISO-8601 `date`. Same staleness signal the GHA `uses:` SHA-pin comments carry. Bump the SHA → bump the row. Run `pnpm run install-claude-plugins` to reconcile a machine to the pinned set — adds the marketplace + installs each plugin at its pinned SHA, no plugin modifications (enforced by `.claude/hooks/marketplace-comment-guard/`).
7373

7474
### Fix it, don't defer
7575

@@ -133,7 +133,7 @@ For non-trivial work (multi-file refactor, new feature, migration), the plan its
133133

134134
### Code style
135135

136-
Default to no comments (enforced by `.claude/hooks/no-meta-comments-guard/` for meta-labels + removed-code refs); when written, write for a junior reader. Parsers mirroring an upstream get the exception ([`docs/claude.md/fleet/parser-comments.md`](docs/claude.md/fleet/parser-comments.md)). Cross-port files (Rust↔Go↔C++↔TS acorn ports; socket-btm `mcp/*.cpp` ports of upstream) use `Lock-step` comments — `//! Lock-step from <path>` for port provenance, `//! Lock-step with <Lang>: <path>` on the canonical side, inline `// Lock-step with <Lang>: <path>:<lines>` for specific cross-refs (point up at the source-of-truth, never down at a port), and `// Lock-step note: <why>` for _deliberate_ divergence (full forms in [`docs/claude.md/fleet/parser-comments.md`](docs/claude.md/fleet/parser-comments.md) §5–6). Pointer comments (`// see X`) need both the destination and an inline one-line claim (enforced by `.claude/hooks/pointer-comment-guard/`). Heaviest invariants: no `TODO`/`FIXME`/stubs; `undefined` over `null`; `httpJson`/`httpText` from `@socketsecurity/lib/http-request` over `fetch()`; `safeDelete()` from `@socketsecurity/lib/fs` over `fs.rm`; Edit tool over `sed`/`awk`; `'CI' in process.env` presence check over truthy; `import os from 'node:os'` over named imports; `getDefaultLogger()` over `console.*` (enforced by `.claude/hooks/logger-guard/`); doc filenames `lowercase-with-hyphens.md` under `docs/` or `.claude/` (enforced by `.claude/hooks/markdown-filename-guard/`). Full ruleset (object literals, imports, subprocesses, file existence, generated reports, sorting, Promise.race, Safe suffix, `node:smol-*`, inclusive language) in [`docs/claude.md/fleet/code-style.md`](docs/claude.md/fleet/code-style.md). See also [`docs/claude.md/fleet/sorting.md`](docs/claude.md/fleet/sorting.md) and [`docs/claude.md/fleet/inclusive-language.md`](docs/claude.md/fleet/inclusive-language.md).
136+
Default to no comments (enforced by `.claude/hooks/no-meta-comments-guard/` for meta-labels + removed-code refs); when written, write for a junior reader. Parsers mirroring an upstream get the exception ([`docs/claude.md/fleet/parser-comments.md`](docs/claude.md/fleet/parser-comments.md)). Cross-port files (Rust↔Go↔C++↔TS acorn ports; socket-btm `mcp/*.cpp` ports of upstream) use `Lock-step` comments — `// Lock-step from <Lang>: <path>` for port provenance, `// Lock-step with <Lang>: <path>` on the canonical side, inline `// Lock-step with <Lang>: <path>:<lines>` for specific cross-refs (point up at the source-of-truth, never down at a port), and `// Lock-step note: <why>` for _deliberate_ divergence. Every member of a quadruplet also carries a byte-identical `// BEGIN LOCK-STEP HEADER` / `// END LOCK-STEP HEADER` block (single-line `// ` syntax across every language — no `//!` / `///` / `/** */` mixing — so byte-compare across the quadruplet is trivial) (full forms in [`docs/claude.md/fleet/parser-comments.md`](docs/claude.md/fleet/parser-comments.md) §5–7; enforced edit-time by `.claude/hooks/lock-step-ref-guard/` and CI-gate-time by `scripts/check-lock-step-refs.mts` + `scripts/check-lock-step-header.mts`; bypass: `Allow lock-step bypass`). Pointer comments (`// see X`) need both the destination and an inline one-line claim (enforced by `.claude/hooks/pointer-comment-guard/`). Heaviest invariants: no `TODO`/`FIXME`/stubs; `undefined` over `null`; `httpJson`/`httpText` from `@socketsecurity/lib/http-request` over `fetch()`; `safeDelete()` from `@socketsecurity/lib/fs` over `fs.rm`; Edit tool over `sed`/`awk`; `'CI' in process.env` presence check over truthy; `import os from 'node:os'` over named imports; `getDefaultLogger()` over `console.*` (enforced by `.claude/hooks/logger-guard/`); doc filenames `lowercase-with-hyphens.md` under `docs/` or `.claude/` (enforced by `.claude/hooks/markdown-filename-guard/`). Full ruleset (object literals, imports, subprocesses, file existence, generated reports, sorting, Promise.race, Safe suffix, `node:smol-*`, inclusive language) in [`docs/claude.md/fleet/code-style.md`](docs/claude.md/fleet/code-style.md). See also [`docs/claude.md/fleet/sorting.md`](docs/claude.md/fleet/sorting.md) and [`docs/claude.md/fleet/inclusive-language.md`](docs/claude.md/fleet/inclusive-language.md).
137137

138138
### File size
139139

@@ -146,6 +146,7 @@ Soft cap **500 lines**, hard cap **1000 lines** per source file. Past those, spl
146146
- **Skill or hook ≠ no rule.** Defense in depth — skill is docs, hook is edit-time, lint is commit-time.
147147
- **Tooling: oxlint + oxfmt only.** No ESLint, no Prettier. Fleet socket-\* oxlint plugin lives in `template/.config/oxlint-plugin/`.
148148
- **Invoke oxfmt / oxlint with `-c .config/...rc.json` explicitly.** Both tools accept a `-c PATH` (oxfmt) / `--config PATH` (oxlint). The fleet keeps both configs under `.config/`, not at repo root. Without the flag, the tools fall through to their built-in defaults — oxfmt's default is double-quotes + semis, the opposite of the fleet style, and would silently rewrite ~200 files on `pnpm run format`. Canonical script bodies in `manifest.mts` already encode the flag; the sync-scaffolding gate rewrites drifted scripts back to the canonical form.
149+
- **No file-scope `oxlint-disable`.** Always use `oxlint-disable-next-line <rule> -- <reason>` per call site so each exemption is independently justified in `git blame`. File-scope blocks silently exempt future edits the author never thought about (enforced by `socket/no-file-scope-oxlint-disable` lint rule + `.claude/hooks/no-file-scope-oxlint-disable-guard/` edit-time guard).
149150

150151
Full rationale + cascade behavior in [`docs/claude.md/fleet/lint-rules.md`](docs/claude.md/fleet/lint-rules.md).
151152

0 commit comments

Comments
 (0)