Skip to content

Commit ae3d1d7

Browse files
committed
chore(sync): apply remaining canonical fleet drift fixes
1 parent d95673f commit ae3d1d7

5 files changed

Lines changed: 48 additions & 2 deletions

File tree

.config/oxfmtrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"**/scripts/ai-lint-fix.mts",
6868
"**/scripts/ai-lint-fix/cli.mts",
6969
"**/scripts/ai-lint-fix/rule-guidance.mts",
70+
"**/scripts/check-lock-step-header.mts",
7071
"**/scripts/check-lock-step-refs.mts",
7172
"**/scripts/check-paths.mts",
7273
"**/scripts/check-paths/allowlist.mts",
@@ -81,6 +82,7 @@
8182
"**/scripts/check-paths/walk.mts",
8283
"**/scripts/check-prompt-less-setup.mts",
8384
"**/scripts/fix.mts",
85+
"**/scripts/install-claude-plugins.mts",
8486
"**/scripts/install-git-hooks.mts",
8587
"**/scripts/install-sfw.mts",
8688
"**/scripts/lint-github-settings.mts",
@@ -100,6 +102,9 @@
100102
"**/scripts/security.mts",
101103
"**/scripts/socket-wheelhouse-emit-schema.mts",
102104
"**/scripts/socket-wheelhouse-schema.mts",
105+
"**/scripts/test/check-lock-step-header.test.mts",
106+
"**/scripts/test/check-lock-step-refs.test.mts",
107+
"**/scripts/test/install-claude-plugins.test.mts",
103108
"**/scripts/test/install-git-hooks.test.mts",
104109
"**/scripts/update.mts",
105110
"**/scripts/validate-bundle-deps.mts",

.config/oxlintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"socket/no-default-export": "error",
4747
"socket/no-dynamic-import-outside-bundle": "error",
4848
"socket/no-fetch-prefer-http-request": "error",
49+
"socket/no-file-scope-oxlint-disable": "error",
4950
"socket/no-inline-logger": "error",
5051
"socket/no-logger-newline-literal": "error",
5152
"socket/no-npx-dlx": "error",
@@ -138,6 +139,7 @@
138139
"**/scripts/ai-lint-fix.mts",
139140
"**/scripts/ai-lint-fix/cli.mts",
140141
"**/scripts/ai-lint-fix/rule-guidance.mts",
142+
"**/scripts/check-lock-step-header.mts",
141143
"**/scripts/check-lock-step-refs.mts",
142144
"**/scripts/check-paths.mts",
143145
"**/scripts/check-paths/allowlist.mts",
@@ -152,6 +154,7 @@
152154
"**/scripts/check-paths/walk.mts",
153155
"**/scripts/check-prompt-less-setup.mts",
154156
"**/scripts/fix.mts",
157+
"**/scripts/install-claude-plugins.mts",
155158
"**/scripts/install-git-hooks.mts",
156159
"**/scripts/install-sfw.mts",
157160
"**/scripts/lint-github-settings.mts",
@@ -171,6 +174,9 @@
171174
"**/scripts/security.mts",
172175
"**/scripts/socket-wheelhouse-emit-schema.mts",
173176
"**/scripts/socket-wheelhouse-schema.mts",
177+
"**/scripts/test/check-lock-step-header.test.mts",
178+
"**/scripts/test/check-lock-step-refs.test.mts",
179+
"**/scripts/test/install-claude-plugins.test.mts",
174180
"**/scripts/test/install-git-hooks.test.mts",
175181
"**/scripts/update.mts",
176182
"**/scripts/validate-bundle-deps.mts",

.gitattributes

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
.claude/hooks/judgment-reminder/package.json linguist-generated=true
113113
.claude/hooks/judgment-reminder/test/index.test.mts linguist-generated=true
114114
.claude/hooks/judgment-reminder/tsconfig.json linguist-generated=true
115+
.claude/hooks/lock-step-ref-guard/README.md linguist-generated=true
116+
.claude/hooks/lock-step-ref-guard/index.mts linguist-generated=true
117+
.claude/hooks/lock-step-ref-guard/package.json linguist-generated=true
118+
.claude/hooks/lock-step-ref-guard/test/index.test.mts linguist-generated=true
119+
.claude/hooks/lock-step-ref-guard/tsconfig.json linguist-generated=true
115120
.claude/hooks/logger-guard/README.md linguist-generated=true
116121
.claude/hooks/logger-guard/index.mts linguist-generated=true
117122
.claude/hooks/logger-guard/package.json linguist-generated=true
@@ -122,6 +127,16 @@
122127
.claude/hooks/markdown-filename-guard/package.json linguist-generated=true
123128
.claude/hooks/markdown-filename-guard/test/index.test.mts linguist-generated=true
124129
.claude/hooks/markdown-filename-guard/tsconfig.json linguist-generated=true
130+
.claude/hooks/marketplace-comment-guard/README.md linguist-generated=true
131+
.claude/hooks/marketplace-comment-guard/index.mts linguist-generated=true
132+
.claude/hooks/marketplace-comment-guard/package.json linguist-generated=true
133+
.claude/hooks/marketplace-comment-guard/test/index.test.mts linguist-generated=true
134+
.claude/hooks/marketplace-comment-guard/tsconfig.json linguist-generated=true
135+
.claude/hooks/minify-mcp-output/README.md linguist-generated=true
136+
.claude/hooks/minify-mcp-output/index.mts linguist-generated=true
137+
.claude/hooks/minify-mcp-output/package.json linguist-generated=true
138+
.claude/hooks/minify-mcp-output/test/index.test.mts linguist-generated=true
139+
.claude/hooks/minify-mcp-output/tsconfig.json linguist-generated=true
125140
.claude/hooks/new-hook-claude-md-guard/README.md linguist-generated=true
126141
.claude/hooks/new-hook-claude-md-guard/index.mts linguist-generated=true
127142
.claude/hooks/new-hook-claude-md-guard/package.json linguist-generated=true
@@ -137,6 +152,10 @@
137152
.claude/hooks/no-external-issue-ref-guard/package.json linguist-generated=true
138153
.claude/hooks/no-external-issue-ref-guard/test/index.test.mts linguist-generated=true
139154
.claude/hooks/no-external-issue-ref-guard/tsconfig.json linguist-generated=true
155+
.claude/hooks/no-file-scope-oxlint-disable-guard/README.md linguist-generated=true
156+
.claude/hooks/no-file-scope-oxlint-disable-guard/index.mts linguist-generated=true
157+
.claude/hooks/no-file-scope-oxlint-disable-guard/package.json linguist-generated=true
158+
.claude/hooks/no-file-scope-oxlint-disable-guard/tsconfig.json linguist-generated=true
140159
.claude/hooks/no-fleet-fork-guard/README.md linguist-generated=true
141160
.claude/hooks/no-fleet-fork-guard/index.mts linguist-generated=true
142161
.claude/hooks/no-fleet-fork-guard/package.json linguist-generated=true
@@ -308,6 +327,7 @@
308327
.claude/skills/worktree-management/SKILL.md linguist-generated=true
309328
.config/lockstep.schema.json linguist-generated=true
310329
.config/oxlint-plugin/index.mts linguist-generated=true
330+
.config/oxlint-plugin/lib/fleet-paths.mts linguist-generated=true
311331
.config/oxlint-plugin/lib/iterable-kind.mts linguist-generated=true
312332
.config/oxlint-plugin/lib/rule-tester.mts linguist-generated=true
313333
.config/oxlint-plugin/lib/rule-types.mts linguist-generated=true
@@ -321,6 +341,7 @@
321341
.config/oxlint-plugin/rules/no-default-export.mts linguist-generated=true
322342
.config/oxlint-plugin/rules/no-dynamic-import-outside-bundle.mts linguist-generated=true
323343
.config/oxlint-plugin/rules/no-fetch-prefer-http-request.mts linguist-generated=true
344+
.config/oxlint-plugin/rules/no-file-scope-oxlint-disable.mts linguist-generated=true
324345
.config/oxlint-plugin/rules/no-inline-logger.mts linguist-generated=true
325346
.config/oxlint-plugin/rules/no-logger-newline-literal.mts linguist-generated=true
326347
.config/oxlint-plugin/rules/no-npx-dlx.mts linguist-generated=true
@@ -446,6 +467,7 @@ packages/build-infra/release-assets.schema.json linguist-generated=true
446467
scripts/ai-lint-fix.mts linguist-generated=true
447468
scripts/ai-lint-fix/cli.mts linguist-generated=true
448469
scripts/ai-lint-fix/rule-guidance.mts linguist-generated=true
470+
scripts/check-lock-step-header.mts linguist-generated=true
449471
scripts/check-lock-step-refs.mts linguist-generated=true
450472
scripts/check-paths.mts linguist-generated=true
451473
scripts/check-paths/allowlist.mts linguist-generated=true
@@ -460,6 +482,7 @@ scripts/check-paths/types.mts linguist-generated=true
460482
scripts/check-paths/walk.mts linguist-generated=true
461483
scripts/check-prompt-less-setup.mts linguist-generated=true
462484
scripts/fix.mts linguist-generated=true
485+
scripts/install-claude-plugins.mts linguist-generated=true
463486
scripts/install-git-hooks.mts linguist-generated=true
464487
scripts/install-sfw.mts linguist-generated=true
465488
scripts/lint-github-settings.mts linguist-generated=true
@@ -479,6 +502,9 @@ scripts/power-state.mts linguist-generated=true
479502
scripts/security.mts linguist-generated=true
480503
scripts/socket-wheelhouse-emit-schema.mts linguist-generated=true
481504
scripts/socket-wheelhouse-schema.mts linguist-generated=true
505+
scripts/test/check-lock-step-header.test.mts linguist-generated=true
506+
scripts/test/check-lock-step-refs.test.mts linguist-generated=true
507+
scripts/test/install-claude-plugins.test.mts linguist-generated=true
482508
scripts/test/install-git-hooks.test.mts linguist-generated=true
483509
scripts/update.mts linguist-generated=true
484510
scripts/validate-bundle-deps.mts linguist-generated=true

CLAUDE.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ Apply in: worktree creation, base-ref resolution for `git diff`/`git rev-list`,
8282
- **Backward compatibility** — FORBIDDEN to maintain. Actively remove when encountered.
8383
- Full ruleset (packageManager field, `.config/` placement, `.mts` runners, soak time, shallow submodules, monorepo `engines.node`) in [`docs/claude.md/fleet/tooling.md`](docs/claude.md/fleet/tooling.md).
8484

85+
### Claude Code plugin pins
86+
87+
🚨 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/`).
88+
89+
### Token minification
90+
91+
Two surfaces apply lossless compression to Claude tool_result payloads — `minify` (JSON whitespace), `strip-lines` (`cat -n` prefixes), `whitespace` (3+ blank lines → 1). All deterministic and information-preserving; no semantic ML compression. **Wire-level proxy**: `@socketsecurity/token-minifier` in [`socket-wheelhouse/packages/`](../packages/socket-token-minifier/) sits between Claude Code and `api.anthropic.com` when `ANTHROPIC_BASE_URL=http://localhost:7779` is set. **In-context hook**: [`.claude/hooks/minify-mcp-output/`](.claude/hooks/minify-mcp-output/) fires PostToolUse on MCP-tool results and returns `hookSpecificOutput.updatedMCPToolOutput` — the only documented rewrite channel for already-collected tool outputs (built-in tools like Read/Bash have no such channel; use the proxy for those) (enforced by `.claude/hooks/minify-mcp-output/`).
92+
8593
### Fix it, don't defer
8694

8795
🚨 See a lint/type/test error or broken comment in your reading window — fix it. Stop current task, fix the issue in a sibling commit, resume. Don't label as "pre-existing", "unrelated", or "out of scope" — the labels are rationalizations (enforced by `.claude/hooks/excuse-detector/`).
@@ -144,7 +152,7 @@ For non-trivial work (multi-file refactor, new feature, migration), the plan its
144152

145153
### Code style
146154

147-
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).
155+
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 `temporal-infra/src/socketsecurity/temporal/*.{cc,h}` C++ port of upstream `temporal_rs` Rust crate) 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).
148156

149157
### File size
150158

@@ -157,6 +165,7 @@ Soft cap **500 lines**, hard cap **1000 lines** per source file. Past those, spl
157165
- **Skill or hook ≠ no rule.** Defense in depth — skill is docs, hook is edit-time, lint is commit-time.
158166
- **Tooling: oxlint + oxfmt only.** No ESLint, no Prettier. Fleet socket-\* oxlint plugin lives in `template/.config/oxlint-plugin/`.
159167
- **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.
168+
- **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).
160169

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"engines": {
3232
"vscode": "^1.63.0"
3333
},
34-
"packageManager": "pnpm@11.1.2",
34+
"packageManager": "pnpm@11.1.3",
3535
"icon": "assets/socket-icon-brand-256.png",
3636
"activationEvents": [
3737
"workspaceContains:**/[pP][aA][cC][kK][aA][gG][eE].[jJ][sS][oO][nN]",

0 commit comments

Comments
 (0)