You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scripts/lib/is-main-module.mjs (isMainModule(importMetaUrl), realpath-resolved on both sides) plus the BLOCKING validator scripts/lib/validate/check-entry-guard.mjs, registered in scripts/validate-plugin.mjs (#1371). The issue's premise was refuted first: the sweep it recorded as landed on f1da471f is unknown to git log --all, and the module it depended on did not exist. 51 files carry the new guard (50 from the enumerated sweep plus scripts/lib/validate/check-unwired-features.mjs as an in-scope same-pattern site); the hand-rolled process.argv[1] comparison came in 15 textual variants, not the 17 the issue claimed. The validator measures 0 fragile of 508 modules on the current tree. Two of its own defects were caught by its own tests before it was registered: a git pathspec ** that silently skipped 95 files, and a file:// occurrence inside a comment counted as a guard.
tests/scripts/pack-install-lifecycle.test.mjs, the test:pack script in package.json and the CI job pack-lifecycle in .gitlab-ci.yml, hard-wired into pipeline-gate's needs (#1375). It installs the ACTUAL tarball rather than the checkout and asserts the installed pre-bash-destructive-guard.mjs denies rm -rf / while staying silent on a benign command. Measured end-to-end in W1: npm pack 15 s, tarball 3,963,485 B, install 3 s / 67 packages. It is deliberately NOT in npm test — it needs the network, so it is its own script and its own job.
Six skill mirrors skills/{close,go,harness-audit,portfolio,release,test}/SKILL.md (plus the generated .agents/ and .cursor/ adapter copies) so the bare commands resolve under claude -p (#1370). Two mechanisms were isolated and proven separately in W1, against claude 2.1.273 with a minimal plugin: /session and /plan are reserved TERMINAL BUILT-INS (they shadow a plugin even with an empty CLAUDE_CONFIG_DIR, so they get the namespaced form documented rather than a mirror), and Unknown command hits exactly those commands/*.md that have no same-named skills/<n>/SKILL.md — a blind prediction confirmed 3/3. Pinned by tests/commands/headless-bare-command-availability.test.mjs.
The send and receive halves of the FILE-SCOPE chain now JOIN on the digest (#1092). hooks/pre-task-scope-disjoint.mjs adds scope_digest, marker_found, echo_instruction_present, instructed_digest and digest_consistent to scope_checked; scripts/lib/scope-echo.mjs gains --verify (6 kebab-case verdicts plus the degraded echo-only and a malformed_lines floor-marker); scripts/materialize-wave-scope.mjs emits orchestrator.wave_dispatch.scope_materialized with transport_observable, and --verify --emit writes orchestrator.wave_dispatch.scope_verified. Before this the halves were unpairable even in principle: 609 send-side against 51 receive-side records whose agent-id sets overlap in ZERO elements. Measured on this session's wave 4: 5/5 matched. New E2E suite tests/hooks/pre-task-scope-injection-e2e.test.mjs plus tests/skills/wave-loop-scope-marker.test.mjs.
resolveSessionStartedAt() / resolveSessionIds() in scripts/lib/state-md.mjs and an optional STATE.md session-id: key (raw UUID) in the wave-executor state-init template (#1368). started_at now comes from session.lock instead of being prose-written, and commands/close.md falls back to readLock().session_id.
STARTED_AT_DRIFT_TOLERANCE_MS (6 h) in scripts/lib/session-close-backfill.mjs (#1368), with a negative test proving a 9 h drift is still rejected.
ownSessionIsEnding on backfillAbandonedSession() plus self-exclusion in planSessions() (scripts/lib/session-close-backfill.mjs, scripts/backfill-abandoned-sessions.mjs, #1376) — the parameter is passed only from hooks/on-session-end.mjs under the #863 attestation guard.
sidecar_missing on orchestrator.agent.stopped in hooks/on-stop.mjs (#1289). It is the DENOMINATOR for every meta-derived field on that record, so a census of agent_type_meta gaps can name how many of them are "sidecar not found" rather than "producer broken".
Maintenance-due signal 7, generated-rules-expiring, in scripts/lib/maintenance-due-banner.mjs (MAINTENANCE_TOTAL_SIGNALS 6 → 7, GENERATED_RULE_EXPIRY_HORIZON_DAYS = 7), backed by the new exports isMachineGeneratedRule / listMachineGeneratedRules / isExpiredGeneratedRule in scripts/lib/instruction-budget-guard.mjs (#1367, instrument half). Measured in W1: rule-loader.mjs filters expires-at only on READ and no code path ever deletes an expired file (3 historical files sat 16–19 days expired on disk and were removed by hand); the entire generated corpus expires within 57 days. The alarm is a session-start banner, not a vitest case, because a test comparing expires-at against TODAY is a calendar time-bomb in a blocking gate — the predicate itself is tested against an injected clock in tests/rules/generated-corpus-expiry.test.mjs.
findLoopedIssueCreate() in hooks/_lib/vcs-create-matcher.mjs plus the xargs bulk deny in hooks/pre-bash-issue-budget.mjs, bound to the causing statement (#1289 B1 and the #1106-class loop lane). Measured at the real hook: xargs forms yielded 0 statements, so the fix is local to the matcher, not an intervention in WRAPPER_UNWRAP.
scripts/lib/reconcile/rule-expiry-sweep.mjs (planRuleExpirySweep/applyRuleExpirySweep) plus CLI scripts/sweep-expired-rules.mjs (#1377) — the missing REMOVAL half of the generated-rule TTL: scripts/lib/rule-loader.mjs already stops injecting an expired generated rule at read time, but nothing ever removed one from disk. --dry-run is the default, --apply is the only write path, --json emits the full plan. An expired entry's prose block is deleted while its ## Provenance pair is kept as markers only (a same-line HTML comment), because /reconcile dedupes on that pair and dropping it would re-propose the learning; a file is deleted only when every pair on it is expired, and every pair is stamped terminal via markCandidateProcessed before the unlink. Two fail-open branches, both reported rather than guessed: an entry whose learning-id does not resolve against learnings.jsonl (unresolvedPairIds) keeps its file, and a file whose ### headings do not map 1:1 onto its non-markers only pairs is reported no-1to1-mapping and left untouched (measured 2026-09-17: the mapping holds in 3 of 7 live files). Writes are refused through a symlink or outside .claude/rules/ (path confinement) and are atomic. Emits orchestrator.rules.expiry_sweep_applied (docs/events-schema.md) on the --apply path only, with rewritten/deleted/stamped/write_errors/expired_entries/files_scanned always present including as 0. Wired into maintenance-loop signal 7's banner (row 3, skills/wave-executor/SKILL.md + skills/session-start/SKILL.md) and documented in docs/rule-authoring.md § "The expiry sweep". Live dry run 2026-09-17: 7 files scanned, 0 rewrites (nothing expired yet), 4 no-1to1-mapping, 5 of 92 provenance-pair ids unresolvable.
scripts/lib/locks/index.mjs restored as a one-cycle export * deprecation shim (0 named exports, one-time console.warn) after having been deleted for 0 importers (see Removed, 5.1.0-cycle) — package.json carries no exports map, so every packed scripts/lib/ path is public and a pre-5.1.0 deep-importer of this path would hit a bare runtime "module not found" with no compile-time warning. Covered by tests/lib/locks/index-shim.test.mjs; removal deferred to 6.0.0 (.claude/rules/development.md § Package Lifecycle & Versioning).
Changed
Every slash command now has exactly ONE definition. 24 commands/*.md files were folded into their same-named skills/<name>/SKILL.md (frontmatter user-invocable: true + argument-hint + disable-model-invocation, body under ## Invocation), leaving commands/session.md and commands/templates-ack.md as the only command files. Reason, measured 2026-09-16 on claude 2.1.273 with a throwaway plugin: Claude Code registers a commands/<name>.md AND a user-invocable skills/<name>/SKILL.md both as /session-orchestrator:<name>, so every twin was listed twice in the interactive / picker; under claude -p the twin ran the SKILL body (the command file was dead), and a user-invocable: false skill beside a command was recognised but ran 0 turns — so the mirrors from #1370 had made /close, /go, /harness-audit, /portfolio, /release and /test duplicates, and discovery, evolve, plan had been silently dead headless all along. The Cursor and Pi generators now emit a wrapper for commands/*.md ∪ skills with explicit user-invocable: true (28 slash commands: 2 + 26), the Codex generator emits the $ARGUMENTS contract for those skills, and tests/commands/headless-bare-command-availability.test.mjs forbids the command/skill twin outright.
Rule-corpus consolidation (#1367, #1372): pathScoped 122,763 → 109,932 B and generated 75,130 → 69,941 B across 7 consolidated files, with 92/92 provenance pairs kept — the provenance pair is what stops /reconcile from re-proposing an absorbed learning, so only the prose was deleted. 9 blocked reconcile proposals were absorbed and 1 rejected as already materialized. .claude/rules/testing.md −7,717 B of web-framework prose (Server Action, E2E, Accessibility, half of CI Integration — a Node CLI repo has no call site for any of it) and .claude/rules/receiving-review.md −562 B with its pin re-derived to 8,009 (#1038) rather than raised.
DEFAULT_GENERATED_BYTE_CEILING in scripts/lib/instruction-budget-guard.mjs 124,000 → 95,000 (#1308), chosen by replaying all 91 historical states of .claude/rules/: the real peak is 99,774 B at 2ae08fe0 (the old docblock claimed 89,763), 124,000 fires 0/91 and 95,000 fires 1/91. The replay is in the docblock, so the next editor can falsify it (HR-105).
docs/rule-authoring.md point 3: paths: is the CANONICAL scope key for .claude/rules/ and globs: an accepted alias, instead of demanding both as byte-identical mirrors. scripts/lib/validate-vendored-rules.mjs's paths-frontmatter probe is re-scoped to rules/ library sources, where it is a vendoring convention (#742) rather than the loader-compatibility gate it was documented as — rule-loader.mjs has accepted paths: since #795.
scripts/lib/command-blocker.mjs traverses into eval literals, dd of= (with conv=notrunc / oflag=append classified as append) and env -S <op> … (#1366). Measured at the real hook beforehand: six previously-open forms were ALLOW on BOTH redirect rules; they now deny, and benign forms stay ALLOW. eval "$CMD" remains a named ceiling (BV-004) — a variable payload is not lexically solvable.
SCOPE_MARKER in scripts/lib/scope-echo.mjs is case-SENSITIVE (#1092). The lowercase match was the cause of this session's 5 unparseable W1 dispatches: the Learnings-Index header contains the words "file scope" and was classified as a FILE-SCOPE block.
isCliEntrypoint() in scripts/lib/validate/check-unwired-features.mjs recognises isMainModule(, export * barrels enter the population, and reportableRoots replaces the basename-collision filter (#1293 remainder) — census of unreachable modules 2 → 0.
commands/{close,go,harness-audit,portfolio,release,test}.md reduced to the entry-contract shape, with the body owned by the new mirrored skill (#1370).
STATE.md started_at is sourced from the session lock in skills/wave-executor/references/wave-executor-state-init.md and skills/_shared/state-ownership.md (#1368) — it was 100 % prose-written before, which is what produced the 48-minute drift that made /close re-run session-end.
Surface counts in docs/components.md (skills 44 → 50) and the session-start / audit docs re-measured against the tree: 50 skills, 39 validators, 25 rule files, 685 test files.
MR !39 merged as 1c02346a (research-evidence contract + hook-development corrections). The panel verdict was MERGE WITH EDITS, and both edits land here: skills/hook-development/SKILL.md now states where and when the UserPromptSubmit field name was checked and that no handler in this plugin exercises either spelling, and skills/_shared/research-evidence.md cross-references PSA-006's executed-command transcript for counts, percentages and distributions.
scripts/lib/validate/check-entry-guard.mjs gains a second oracle for the bare process.argv[1].endsWith('<x>.mjs') basename form (plus its ?., String(...) and (argv[1] || '') receiver variants) alongside the existing ===/!== comparison oracle — the two hand-written guards this check was originally built to catch (scripts/lib/ecosystem-wizard.mjs, scripts/lib/fetch-baseline.mjs, see Fixed) used the bare form, which the comparison oracle could never see, so reverting either file's fix would have been caught by nothing. ALLOWLIST is now empty (its one entry, for fetch-baseline.mjs's hybrid guard, no longer applies) but the mechanism is kept rather than deleted.
scripts/lib/validate/check-skill-links.mjs scans .cursor/rules (added to SCAN_DIRS) including its .mdc extension (new MD_EXTENSIONS export) — that surface ships in the npm tarball and, after #1370 folded commands/go.md/commands/close.md into skills, carried two now-dangling citations of them. Measured 2026-09-17: .cursor/rules/*.mdc contains zero [text](target) links today, so the widening adds 9 scanned files and 0 checked links — it is a forward guard, not a catch of the backticked-code-span citation class that actually caused the dangling reference (see Fixed for that repair).
skills/claude-md-drift-check/checker.mjs extracts countSlashCommands() (the commands/*.md ∪ user-invocable-skills union, deduplicated) as the ONE implementation shared by the command-count surface (Check 5) and the docs-parity sub-check (Check 10) — the two counters had drifted independently since #1370 folded 24 command files into skills, leaving docs-parity on a raw commands/readdirSync() that undercounted; the check now reports ok / exit 0 where it was red on HEAD.
scripts/generate-cursor-adapter.mjs reads disable-model-invocation from the SOURCE skill's own frontmatter (new disablesModelInvocation(): emit when the source declares it, OR when the skill is not user-invocable at all) instead of deriving it from user-invocable — 6 skills that are both user-invocable: true AND operator-only (bootstrap, brainstorm, close, go, plan, release) had silently lost the flag on both their .cursor/commands/*.md and .cursor/skills/*/SKILL.md wrappers, which would let a Cursor model auto-invoke /close, /go or /release. The generator now delegates to scripts/lib/user-invocable-skills.mjs's isUserInvocableValue() (see below) and tolerates a UTF-8 BOM / CRLF frontmatter block, which previously made it parse as "no frontmatter" at all.
scripts/lib/user-invocable-skills.mjs's isUserInvocableValue() is now the one user-invocable normaliser for the Cursor, Pi and Codex generators and every counter — it strips a trailing # comment and one layer of matching quotes before comparing, accepts case-insensitive true, and WARNs (without accepting) on the YAML-1.1-but-not-1.2 lookalikes yes/y/on/t/1, which generate-codex-skills's js-yaml CORE_SCHEMA reads as plain strings rather than booleans.
scripts/lib/agent-frontmatter.mjs's parseAgentFrontmatter() no longer hoists a key nested under a top-level mapping (e.g. metadata:\n user-invocable: true) up to top level, and strips a leading UTF-8 BOM before matching the frontmatter fence — both previously made a counter see a slash command no generator recognised.
scripts/release.mjs's --check/--publish CI-preflight rows (ci-green-on-head, ci-green-on-head-github) now query both platforms for the commit actually being released (new exported evaluateCiPreflightRows(repoRoot, head, opts), sha: head) instead of letting the GitHub branch fall back to the mirror's own HEAD — before head-pushed-github proves github/main == local HEAD, the GitHub row could read green for a commit GitHub had never seen (measured 2026-09-16 for 3ebf0e9d).
skills/autopilot/SKILL.md documents the Headless Driver Wiring (Option A, scripts/autopilot.mjs) as its own subsection rather than folded verbatim into the old command text, and corrects its DI table's resourceEvaluator/peerCounter rows to match the live code: peerCounter returns a SESSION count via detectPeers(), not a process count (.claude/rules/host-resources.md § HR-103), and refreshes the cached probe snapshot resourceEvaluator reads rather than each calling probe() independently. skills/dispatcher/SKILL.md Phase 4 documents /session and /plan as reserved-terminal-built-in / disable-model-invocation-blocked names the coordinator hands to the operator to type verbatim, versus /discovery, which carries neither restriction and the coordinator invokes directly.
Fixed
Destructive-command policy census in CLAUDE.md / AGENTS.md, .orchestrator/steering/structure.md and docs/components.md still said 14 rules / 10 blocking; the 15th rule (redirect-harness-memory, landed 2026-09-13) makes it 15 rules, 11 blocking, 4 warning (measured 2026-09-16 at 68fbebf9). README.md said 44 skills against 50 on disk. Both found by the /close discovery scan (ssot-code-diff).