@memnexus-ai/mx-agent-cli 0.1.294 → 0.1.295-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/agents-md-canonicalization.test.js +31 -1
- package/dist/__tests__/agents-md-canonicalization.test.js.map +1 -1
- package/dist/__tests__/behavioral-extraction.test.js +50 -0
- package/dist/__tests__/behavioral-extraction.test.js.map +1 -1
- package/dist/__tests__/bootstrap-behavioral-contract.test.js +6 -3
- package/dist/__tests__/bootstrap-behavioral-contract.test.js.map +1 -1
- package/dist/__tests__/bundle-config.test.js +28 -2
- package/dist/__tests__/bundle-config.test.js.map +1 -1
- package/dist/__tests__/catalog-interaction.test.d.ts +25 -0
- package/dist/__tests__/catalog-interaction.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-interaction.test.js +269 -0
- package/dist/__tests__/catalog-interaction.test.js.map +1 -0
- package/dist/__tests__/catalog-named-memories.test.d.ts +2 -0
- package/dist/__tests__/catalog-named-memories.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-named-memories.test.js +204 -0
- package/dist/__tests__/catalog-named-memories.test.js.map +1 -0
- package/dist/__tests__/catalog-origin-main.test.d.ts +15 -0
- package/dist/__tests__/catalog-origin-main.test.d.ts.map +1 -0
- package/dist/__tests__/catalog-origin-main.test.js +296 -0
- package/dist/__tests__/catalog-origin-main.test.js.map +1 -0
- package/dist/__tests__/catalog.test.d.ts +2 -0
- package/dist/__tests__/catalog.test.d.ts.map +1 -0
- package/dist/__tests__/catalog.test.js +131 -0
- package/dist/__tests__/catalog.test.js.map +1 -0
- package/dist/__tests__/cli-build-integration.test.d.ts +2 -0
- package/dist/__tests__/cli-build-integration.test.d.ts.map +1 -0
- package/dist/__tests__/cli-build-integration.test.js +64 -0
- package/dist/__tests__/cli-build-integration.test.js.map +1 -0
- package/dist/__tests__/cli-build.test.d.ts +2 -0
- package/dist/__tests__/cli-build.test.d.ts.map +1 -0
- package/dist/__tests__/cli-build.test.js +640 -0
- package/dist/__tests__/cli-build.test.js.map +1 -0
- package/dist/__tests__/codex-deploy-config.test.js +60 -0
- package/dist/__tests__/codex-deploy-config.test.js.map +1 -1
- package/dist/__tests__/completion-rows-discriminate.test.d.ts +20 -0
- package/dist/__tests__/completion-rows-discriminate.test.d.ts.map +1 -0
- package/dist/__tests__/completion-rows-discriminate.test.js +481 -0
- package/dist/__tests__/completion-rows-discriminate.test.js.map +1 -0
- package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts +2 -0
- package/dist/__tests__/config-fidelity-archived-symlinks.test.d.ts.map +1 -0
- package/dist/__tests__/config-fidelity-archived-symlinks.test.js +127 -0
- package/dist/__tests__/config-fidelity-archived-symlinks.test.js.map +1 -0
- package/dist/__tests__/config-fidelity-display.test.d.ts +2 -0
- package/dist/__tests__/config-fidelity-display.test.d.ts.map +1 -0
- package/dist/__tests__/config-fidelity-display.test.js +77 -0
- package/dist/__tests__/config-fidelity-display.test.js.map +1 -0
- package/dist/__tests__/config-fidelity.test.js +166 -33
- package/dist/__tests__/config-fidelity.test.js.map +1 -1
- package/dist/__tests__/config-generation-gate.test.js +78 -0
- package/dist/__tests__/config-generation-gate.test.js.map +1 -1
- package/dist/__tests__/config-sync.test.js +89 -1
- package/dist/__tests__/config-sync.test.js.map +1 -1
- package/dist/__tests__/coordination-401-production-wiring.test.js +12 -7
- package/dist/__tests__/coordination-401-production-wiring.test.js.map +1 -1
- package/dist/__tests__/coordination-401-recovery.test.js +39 -32
- package/dist/__tests__/coordination-401-recovery.test.js.map +1 -1
- package/dist/__tests__/coordination-brief-pin.test.js +21 -8
- package/dist/__tests__/coordination-brief-pin.test.js.map +1 -1
- package/dist/__tests__/coordination-client.test.js +227 -3
- package/dist/__tests__/coordination-client.test.js.map +1 -1
- package/dist/__tests__/coordination-credential-endpoint.test.d.ts +24 -0
- package/dist/__tests__/coordination-credential-endpoint.test.d.ts.map +1 -0
- package/dist/__tests__/coordination-credential-endpoint.test.js +1230 -0
- package/dist/__tests__/coordination-credential-endpoint.test.js.map +1 -0
- package/dist/__tests__/coordination-memory.test.js +20 -4
- package/dist/__tests__/coordination-memory.test.js.map +1 -1
- package/dist/__tests__/coordination-provision.test.js +22 -14
- package/dist/__tests__/coordination-provision.test.js.map +1 -1
- package/dist/__tests__/coordination-status-registration.test.d.ts +16 -0
- package/dist/__tests__/coordination-status-registration.test.d.ts.map +1 -0
- package/dist/__tests__/coordination-status-registration.test.js +480 -0
- package/dist/__tests__/coordination-status-registration.test.js.map +1 -0
- package/dist/__tests__/coordination-token-multitenant.test.js +11 -11
- package/dist/__tests__/coordination-token-multitenant.test.js.map +1 -1
- package/dist/__tests__/coordination-token.test.js +35 -28
- package/dist/__tests__/coordination-token.test.js.map +1 -1
- package/dist/__tests__/creation-pr-class-check.test.d.ts +17 -0
- package/dist/__tests__/creation-pr-class-check.test.d.ts.map +1 -0
- package/dist/__tests__/creation-pr-class-check.test.js +346 -0
- package/dist/__tests__/creation-pr-class-check.test.js.map +1 -0
- package/dist/__tests__/decision-check.test.d.ts +2 -0
- package/dist/__tests__/decision-check.test.d.ts.map +1 -0
- package/dist/__tests__/decision-check.test.js +105 -0
- package/dist/__tests__/decision-check.test.js.map +1 -0
- package/dist/__tests__/digest-team-omission.test.d.ts +15 -0
- package/dist/__tests__/digest-team-omission.test.d.ts.map +1 -0
- package/dist/__tests__/digest-team-omission.test.js +247 -0
- package/dist/__tests__/digest-team-omission.test.js.map +1 -0
- package/dist/__tests__/doctor-worktree-path.test.d.ts +17 -0
- package/dist/__tests__/doctor-worktree-path.test.d.ts.map +1 -0
- package/dist/__tests__/doctor-worktree-path.test.js +158 -0
- package/dist/__tests__/doctor-worktree-path.test.js.map +1 -0
- package/dist/__tests__/fleet-data.test.js +40 -7
- package/dist/__tests__/fleet-data.test.js.map +1 -1
- package/dist/__tests__/fleet-tmux.test.js +2 -2
- package/dist/__tests__/fleet-tmux.test.js.map +1 -1
- package/dist/__tests__/generate-claude.test.js +137 -3
- package/dist/__tests__/generate-claude.test.js.map +1 -1
- package/dist/__tests__/git-env.test.d.ts +14 -0
- package/dist/__tests__/git-env.test.d.ts.map +1 -0
- package/dist/__tests__/git-env.test.js +131 -0
- package/dist/__tests__/git-env.test.js.map +1 -0
- package/dist/__tests__/git-identity-isolation.test.d.ts +33 -0
- package/dist/__tests__/git-identity-isolation.test.d.ts.map +1 -0
- package/dist/__tests__/git-identity-isolation.test.js +626 -0
- package/dist/__tests__/git-identity-isolation.test.js.map +1 -0
- package/dist/__tests__/harness-extract.test.d.ts +19 -0
- package/dist/__tests__/harness-extract.test.d.ts.map +1 -0
- package/dist/__tests__/harness-extract.test.js +566 -0
- package/dist/__tests__/harness-extract.test.js.map +1 -0
- package/dist/__tests__/harness-wiring.test.d.ts +16 -0
- package/dist/__tests__/harness-wiring.test.d.ts.map +1 -0
- package/dist/__tests__/harness-wiring.test.js +469 -0
- package/dist/__tests__/harness-wiring.test.js.map +1 -0
- package/dist/__tests__/hook-heal.test.js +17 -0
- package/dist/__tests__/hook-heal.test.js.map +1 -1
- package/dist/__tests__/init-coordination-url.test.d.ts +11 -0
- package/dist/__tests__/init-coordination-url.test.d.ts.map +1 -0
- package/dist/__tests__/init-coordination-url.test.js +114 -0
- package/dist/__tests__/init-coordination-url.test.js.map +1 -0
- package/dist/__tests__/memory-autocreate.test.js +574 -8
- package/dist/__tests__/memory-autocreate.test.js.map +1 -1
- package/dist/__tests__/memory-log-result.test.d.ts +13 -0
- package/dist/__tests__/memory-log-result.test.d.ts.map +1 -0
- package/dist/__tests__/memory-log-result.test.js +113 -0
- package/dist/__tests__/memory-log-result.test.js.map +1 -0
- package/dist/__tests__/memory-named-exists.test.d.ts +16 -0
- package/dist/__tests__/memory-named-exists.test.d.ts.map +1 -0
- package/dist/__tests__/memory-named-exists.test.js +288 -0
- package/dist/__tests__/memory-named-exists.test.js.map +1 -0
- package/dist/__tests__/mx-agent-cli-pin-validation.test.js +23 -47
- package/dist/__tests__/mx-agent-cli-pin-validation.test.js.map +1 -1
- package/dist/__tests__/mx-agent-cli-version-pin.test.js +34 -88
- package/dist/__tests__/mx-agent-cli-version-pin.test.js.map +1 -1
- package/dist/__tests__/new-project-first-team.test.d.ts +15 -0
- package/dist/__tests__/new-project-first-team.test.d.ts.map +1 -0
- package/dist/__tests__/new-project-first-team.test.js +263 -0
- package/dist/__tests__/new-project-first-team.test.js.map +1 -0
- package/dist/__tests__/otel-env.test.d.ts +2 -0
- package/dist/__tests__/otel-env.test.d.ts.map +1 -0
- package/dist/__tests__/otel-env.test.js +127 -0
- package/dist/__tests__/otel-env.test.js.map +1 -0
- package/dist/__tests__/project-config.test.js +283 -1
- package/dist/__tests__/project-config.test.js.map +1 -1
- package/dist/__tests__/provision-behavioral-contract.test.js +96 -4
- package/dist/__tests__/provision-behavioral-contract.test.js.map +1 -1
- package/dist/__tests__/provision-catalog-precondition.test.d.ts +26 -0
- package/dist/__tests__/provision-catalog-precondition.test.d.ts.map +1 -0
- package/dist/__tests__/provision-catalog-precondition.test.js +620 -0
- package/dist/__tests__/provision-catalog-precondition.test.js.map +1 -0
- package/dist/__tests__/provision-completion-rows.test.d.ts +17 -0
- package/dist/__tests__/provision-completion-rows.test.d.ts.map +1 -0
- package/dist/__tests__/provision-completion-rows.test.js +3095 -0
- package/dist/__tests__/provision-completion-rows.test.js.map +1 -0
- package/dist/__tests__/provision-identity-gate.test.d.ts +20 -0
- package/dist/__tests__/provision-identity-gate.test.d.ts.map +1 -0
- package/dist/__tests__/provision-identity-gate.test.js +600 -0
- package/dist/__tests__/provision-identity-gate.test.js.map +1 -0
- package/dist/__tests__/provision-resume.test.d.ts +26 -0
- package/dist/__tests__/provision-resume.test.d.ts.map +1 -0
- package/dist/__tests__/provision-resume.test.js +1164 -0
- package/dist/__tests__/provision-resume.test.js.map +1 -0
- package/dist/__tests__/provision-roleguide-anchors.test.d.ts +27 -0
- package/dist/__tests__/provision-roleguide-anchors.test.d.ts.map +1 -0
- package/dist/__tests__/provision-roleguide-anchors.test.js +747 -0
- package/dist/__tests__/provision-roleguide-anchors.test.js.map +1 -0
- package/dist/__tests__/provision-skeleton-fill.test.d.ts +16 -0
- package/dist/__tests__/provision-skeleton-fill.test.d.ts.map +1 -0
- package/dist/__tests__/provision-skeleton-fill.test.js +488 -0
- package/dist/__tests__/provision-skeleton-fill.test.js.map +1 -0
- package/dist/__tests__/provision-teambuilder-flow.test.js +93 -7
- package/dist/__tests__/provision-teambuilder-flow.test.js.map +1 -1
- package/dist/__tests__/repo-guard-wiring.test.d.ts +21 -0
- package/dist/__tests__/repo-guard-wiring.test.d.ts.map +1 -0
- package/dist/__tests__/repo-guard-wiring.test.js +638 -0
- package/dist/__tests__/repo-guard-wiring.test.js.map +1 -0
- package/dist/__tests__/report-format.test.d.ts +2 -0
- package/dist/__tests__/report-format.test.d.ts.map +1 -0
- package/dist/__tests__/report-format.test.js +219 -0
- package/dist/__tests__/report-format.test.js.map +1 -0
- package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts +2 -0
- package/dist/__tests__/runtime-codex-gateway-pilot.test.d.ts.map +1 -0
- package/dist/__tests__/runtime-codex-gateway-pilot.test.js +309 -0
- package/dist/__tests__/runtime-codex-gateway-pilot.test.js.map +1 -0
- package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts +2 -0
- package/dist/__tests__/runtime-codex-gateway-provider.test.d.ts.map +1 -0
- package/dist/__tests__/runtime-codex-gateway-provider.test.js +163 -0
- package/dist/__tests__/runtime-codex-gateway-provider.test.js.map +1 -0
- package/dist/__tests__/runtime-identity.test.d.ts +2 -0
- package/dist/__tests__/runtime-identity.test.d.ts.map +1 -0
- package/dist/__tests__/runtime-identity.test.js +117 -0
- package/dist/__tests__/runtime-identity.test.js.map +1 -0
- package/dist/__tests__/session-pause-provisioning.test.js +6 -1
- package/dist/__tests__/session-pause-provisioning.test.js.map +1 -1
- package/dist/__tests__/session-record-disclosure.test.d.ts +24 -0
- package/dist/__tests__/session-record-disclosure.test.d.ts.map +1 -0
- package/dist/__tests__/session-record-disclosure.test.js +494 -0
- package/dist/__tests__/session-record-disclosure.test.js.map +1 -0
- package/dist/__tests__/session.test.js +35 -0
- package/dist/__tests__/session.test.js.map +1 -1
- package/dist/__tests__/slug-validation.test.js +27 -21
- package/dist/__tests__/slug-validation.test.js.map +1 -1
- package/dist/__tests__/standards-injection.test.d.ts +2 -0
- package/dist/__tests__/standards-injection.test.d.ts.map +1 -0
- package/dist/__tests__/standards-injection.test.js +179 -0
- package/dist/__tests__/standards-injection.test.js.map +1 -0
- package/dist/__tests__/start-interactive-role.test.d.ts +22 -0
- package/dist/__tests__/start-interactive-role.test.d.ts.map +1 -0
- package/dist/__tests__/start-interactive-role.test.js +204 -0
- package/dist/__tests__/start-interactive-role.test.js.map +1 -0
- package/dist/__tests__/start-team-identity.test.d.ts +25 -0
- package/dist/__tests__/start-team-identity.test.d.ts.map +1 -0
- package/dist/__tests__/start-team-identity.test.js +307 -0
- package/dist/__tests__/start-team-identity.test.js.map +1 -0
- package/dist/__tests__/team-memory-commands.test.js +142 -19
- package/dist/__tests__/team-memory-commands.test.js.map +1 -1
- package/dist/__tests__/template-sync.test.d.ts +19 -0
- package/dist/__tests__/template-sync.test.d.ts.map +1 -0
- package/dist/__tests__/template-sync.test.js +270 -0
- package/dist/__tests__/template-sync.test.js.map +1 -0
- package/dist/__tests__/test-project.test.d.ts +18 -0
- package/dist/__tests__/test-project.test.d.ts.map +1 -0
- package/dist/__tests__/test-project.test.js +465 -0
- package/dist/__tests__/test-project.test.js.map +1 -0
- package/dist/__tests__/usage-per-call-grouping.test.d.ts +25 -0
- package/dist/__tests__/usage-per-call-grouping.test.d.ts.map +1 -0
- package/dist/__tests__/usage-per-call-grouping.test.js +952 -0
- package/dist/__tests__/usage-per-call-grouping.test.js.map +1 -0
- package/dist/__tests__/verify-hooks-check-all.test.d.ts +32 -0
- package/dist/__tests__/verify-hooks-check-all.test.d.ts.map +1 -0
- package/dist/__tests__/verify-hooks-check-all.test.js +553 -0
- package/dist/__tests__/verify-hooks-check-all.test.js.map +1 -0
- package/dist/__tests__/worktree-sync-fixture.test.d.ts +17 -0
- package/dist/__tests__/worktree-sync-fixture.test.d.ts.map +1 -0
- package/dist/__tests__/worktree-sync-fixture.test.js +519 -0
- package/dist/__tests__/worktree-sync-fixture.test.js.map +1 -0
- package/dist/__tests__/worktree-sync-hardening.test.d.ts +13 -0
- package/dist/__tests__/worktree-sync-hardening.test.d.ts.map +1 -0
- package/dist/__tests__/worktree-sync-hardening.test.js +919 -0
- package/dist/__tests__/worktree-sync-hardening.test.js.map +1 -0
- package/dist/__tests__/worktree-sync-shell-free.test.d.ts +25 -0
- package/dist/__tests__/worktree-sync-shell-free.test.d.ts.map +1 -0
- package/dist/__tests__/worktree-sync-shell-free.test.js +185 -0
- package/dist/__tests__/worktree-sync-shell-free.test.js.map +1 -0
- package/dist/__tests__/worktree.test.js +75 -1
- package/dist/__tests__/worktree.test.js.map +1 -1
- package/dist/agent-config/.mx-config-generation.json +2 -2
- package/dist/agent-config/AGENTS.md.template +2 -2
- package/dist/agent-config/agents/bar-raiser.md +34 -1
- package/dist/agent-config/agents/red-team.md +34 -1
- package/dist/agent-config/agents/security-reviewer.md +22 -1
- package/dist/agent-config/claude-md/CLAUDE.core.md +6 -1
- package/dist/agent-config/claude-md/CLAUDE.overlay.memnexus.md +1 -3
- package/dist/agent-config/coordination-rosters.generated.json +10 -0
- package/dist/agent-config/hooks/HOOK-TIMEOUTS.md +27 -1
- package/dist/agent-config/hooks/OR-TRUE-AUDIT.md +8 -8
- package/dist/agent-config/hooks/auto-capture-precompact.sh +180 -83
- package/dist/agent-config/hooks/auto-capture-session-end.sh +216 -87
- package/dist/agent-config/hooks/auto-checkpoint.sh +75 -5
- package/dist/agent-config/hooks/coordination-brief.sh +290 -245
- package/dist/agent-config/hooks/deploy-verification-reminder.sh +359 -22
- package/dist/agent-config/hooks/git-mutation-guard.sh +85 -13
- package/dist/agent-config/hooks/observability-sync.sh +46 -9
- package/dist/agent-config/hooks/session-idle-gate.sh +177 -12
- package/dist/agent-config/hooks/subagent-write-guard.sh +670 -0
- package/dist/agent-config/hooks/worktree-guard.sh +36 -7
- package/dist/agent-config/settings.json +15 -2
- package/dist/agent-config/shared/creation-pr-review-checklist.md +317 -0
- package/dist/commands/bootstrap.d.ts.map +1 -1
- package/dist/commands/bootstrap.js +22 -10
- package/dist/commands/bootstrap.js.map +1 -1
- package/dist/commands/config-sync.d.ts +37 -0
- package/dist/commands/config-sync.d.ts.map +1 -1
- package/dist/commands/config-sync.js +36 -18
- package/dist/commands/config-sync.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +28 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/coordination.d.ts +150 -8
- package/dist/commands/coordination.d.ts.map +1 -1
- package/dist/commands/coordination.js +519 -25
- package/dist/commands/coordination.js.map +1 -1
- package/dist/commands/create.d.ts +913 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +4879 -345
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +10 -2
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decision.d.ts +20 -0
- package/dist/commands/decision.d.ts.map +1 -0
- package/dist/commands/decision.js +54 -0
- package/dist/commands/decision.js.map +1 -0
- package/dist/commands/digest.d.ts.map +1 -1
- package/dist/commands/digest.js +91 -7
- package/dist/commands/digest.js.map +1 -1
- package/dist/commands/fleet-tmux.js +1 -1
- package/dist/commands/fleet-tmux.js.map +1 -1
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +26 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.d.ts +32 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +98 -5
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/monitor.d.ts.map +1 -1
- package/dist/commands/monitor.js +8 -2
- package/dist/commands/monitor.js.map +1 -1
- package/dist/commands/new.d.ts +2 -0
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +114 -21
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/report.d.ts +33 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +73 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/session.js +1 -1
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/start.d.ts +42 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +177 -8
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/sync.d.ts +57 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +117 -3
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/update.d.ts +13 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +50 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/usage.d.ts +64 -0
- package/dist/commands/usage.d.ts.map +1 -1
- package/dist/commands/usage.js +96 -3
- package/dist/commands/usage.js.map +1 -1
- package/dist/commands/verify-hooks.d.ts +37 -1
- package/dist/commands/verify-hooks.d.ts.map +1 -1
- package/dist/commands/verify-hooks.js +114 -2
- package/dist/commands/verify-hooks.js.map +1 -1
- package/dist/commands/window.d.ts +10 -0
- package/dist/commands/window.d.ts.map +1 -0
- package/dist/commands/window.js +265 -0
- package/dist/commands/window.js.map +1 -0
- package/dist/commands/worktree-sync.d.ts +54 -0
- package/dist/commands/worktree-sync.d.ts.map +1 -0
- package/dist/commands/worktree-sync.js +135 -0
- package/dist/commands/worktree-sync.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +189 -14
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-session.d.ts +12 -0
- package/dist/lib/agent-session.d.ts.map +1 -1
- package/dist/lib/agent-session.js +189 -42
- package/dist/lib/agent-session.js.map +1 -1
- package/dist/lib/catalog.d.ts +321 -2
- package/dist/lib/catalog.d.ts.map +1 -1
- package/dist/lib/catalog.js +490 -11
- package/dist/lib/catalog.js.map +1 -1
- package/dist/lib/claude.d.ts +65 -23
- package/dist/lib/claude.d.ts.map +1 -1
- package/dist/lib/claude.js +335 -19
- package/dist/lib/claude.js.map +1 -1
- package/dist/lib/cli-build.d.ts +172 -0
- package/dist/lib/cli-build.d.ts.map +1 -0
- package/dist/lib/cli-build.js +654 -0
- package/dist/lib/cli-build.js.map +1 -0
- package/dist/lib/code-context-file.d.ts +109 -0
- package/dist/lib/code-context-file.d.ts.map +1 -0
- package/dist/lib/code-context-file.js +219 -0
- package/dist/lib/code-context-file.js.map +1 -0
- package/dist/lib/code-context-file.test.d.ts +19 -0
- package/dist/lib/code-context-file.test.d.ts.map +1 -0
- package/dist/lib/code-context-file.test.js +202 -0
- package/dist/lib/code-context-file.test.js.map +1 -0
- package/dist/lib/config-fidelity.d.ts +40 -20
- package/dist/lib/config-fidelity.d.ts.map +1 -1
- package/dist/lib/config-fidelity.js +144 -56
- package/dist/lib/config-fidelity.js.map +1 -1
- package/dist/lib/coordination-client.d.ts +73 -0
- package/dist/lib/coordination-client.d.ts.map +1 -1
- package/dist/lib/coordination-client.js +180 -8
- package/dist/lib/coordination-client.js.map +1 -1
- package/dist/lib/coordination-token.d.ts +304 -6
- package/dist/lib/coordination-token.d.ts.map +1 -1
- package/dist/lib/coordination-token.js +851 -52
- package/dist/lib/coordination-token.js.map +1 -1
- package/dist/lib/decision-check.d.ts +48 -0
- package/dist/lib/decision-check.d.ts.map +1 -0
- package/dist/lib/decision-check.js +149 -0
- package/dist/lib/decision-check.js.map +1 -0
- package/dist/lib/fleet-data.d.ts +34 -0
- package/dist/lib/fleet-data.d.ts.map +1 -1
- package/dist/lib/fleet-data.js +37 -9
- package/dist/lib/fleet-data.js.map +1 -1
- package/dist/lib/fleet-render.js +1 -1
- package/dist/lib/fleet-render.js.map +1 -1
- package/dist/lib/git-identity.d.ts +302 -0
- package/dist/lib/git-identity.d.ts.map +1 -0
- package/dist/lib/git-identity.js +546 -0
- package/dist/lib/git-identity.js.map +1 -0
- package/dist/lib/harness/console/announce.d.ts +45 -0
- package/dist/lib/harness/console/announce.d.ts.map +1 -0
- package/dist/lib/harness/console/announce.js +48 -0
- package/dist/lib/harness/console/announce.js.map +1 -0
- package/dist/lib/harness/console/announce.test.d.ts +2 -0
- package/dist/lib/harness/console/announce.test.d.ts.map +1 -0
- package/dist/lib/harness/console/announce.test.js +104 -0
- package/dist/lib/harness/console/announce.test.js.map +1 -0
- package/dist/lib/harness/console/by-session.d.ts +50 -0
- package/dist/lib/harness/console/by-session.d.ts.map +1 -0
- package/dist/lib/harness/console/by-session.js +83 -0
- package/dist/lib/harness/console/by-session.js.map +1 -0
- package/dist/lib/harness/console/by-session.test.d.ts +2 -0
- package/dist/lib/harness/console/by-session.test.d.ts.map +1 -0
- package/dist/lib/harness/console/by-session.test.js +86 -0
- package/dist/lib/harness/console/by-session.test.js.map +1 -0
- package/dist/lib/harness/console/console.d.ts +67 -0
- package/dist/lib/harness/console/console.d.ts.map +1 -0
- package/dist/lib/harness/console/console.js +373 -0
- package/dist/lib/harness/console/console.js.map +1 -0
- package/dist/lib/harness/console/console.test.d.ts +2 -0
- package/dist/lib/harness/console/console.test.d.ts.map +1 -0
- package/dist/lib/harness/console/console.test.js +269 -0
- package/dist/lib/harness/console/console.test.js.map +1 -0
- package/dist/lib/harness/console/decision-request.d.ts +32 -0
- package/dist/lib/harness/console/decision-request.d.ts.map +1 -0
- package/dist/lib/harness/console/decision-request.js +112 -0
- package/dist/lib/harness/console/decision-request.js.map +1 -0
- package/dist/lib/harness/console/decision-request.test.d.ts +2 -0
- package/dist/lib/harness/console/decision-request.test.d.ts.map +1 -0
- package/dist/lib/harness/console/decision-request.test.js +75 -0
- package/dist/lib/harness/console/decision-request.test.js.map +1 -0
- package/dist/lib/harness/console/fixtures.d.ts +16 -0
- package/dist/lib/harness/console/fixtures.d.ts.map +1 -0
- package/dist/lib/harness/console/fixtures.js +49 -0
- package/dist/lib/harness/console/fixtures.js.map +1 -0
- package/dist/lib/harness/console/index.d.ts +15 -0
- package/dist/lib/harness/console/index.d.ts.map +1 -0
- package/dist/lib/harness/console/index.js +14 -0
- package/dist/lib/harness/console/index.js.map +1 -0
- package/dist/lib/harness/console/rank.d.ts +73 -0
- package/dist/lib/harness/console/rank.d.ts.map +1 -0
- package/dist/lib/harness/console/rank.js +113 -0
- package/dist/lib/harness/console/rank.js.map +1 -0
- package/dist/lib/harness/console/rank.test.d.ts +2 -0
- package/dist/lib/harness/console/rank.test.d.ts.map +1 -0
- package/dist/lib/harness/console/rank.test.js +124 -0
- package/dist/lib/harness/console/rank.test.js.map +1 -0
- package/dist/lib/harness/console/render.d.ts +22 -0
- package/dist/lib/harness/console/render.d.ts.map +1 -0
- package/dist/lib/harness/console/render.js +65 -0
- package/dist/lib/harness/console/render.js.map +1 -0
- package/dist/lib/harness/console/render.test.d.ts +2 -0
- package/dist/lib/harness/console/render.test.d.ts.map +1 -0
- package/dist/lib/harness/console/render.test.js +96 -0
- package/dist/lib/harness/console/render.test.js.map +1 -0
- package/dist/lib/harness/console/replay-cli.test.d.ts +2 -0
- package/dist/lib/harness/console/replay-cli.test.d.ts.map +1 -0
- package/dist/lib/harness/console/replay-cli.test.js +96 -0
- package/dist/lib/harness/console/replay-cli.test.js.map +1 -0
- package/dist/lib/harness/console/replay.d.ts +36 -0
- package/dist/lib/harness/console/replay.d.ts.map +1 -0
- package/dist/lib/harness/console/replay.js +59 -0
- package/dist/lib/harness/console/replay.js.map +1 -0
- package/dist/lib/harness/console/replay.test.d.ts +2 -0
- package/dist/lib/harness/console/replay.test.d.ts.map +1 -0
- package/dist/lib/harness/console/replay.test.js +81 -0
- package/dist/lib/harness/console/replay.test.js.map +1 -0
- package/dist/lib/harness/console/turn-reader.d.ts +50 -0
- package/dist/lib/harness/console/turn-reader.d.ts.map +1 -0
- package/dist/lib/harness/console/turn-reader.js +184 -0
- package/dist/lib/harness/console/turn-reader.js.map +1 -0
- package/dist/lib/harness/console/turn-reader.test.d.ts +2 -0
- package/dist/lib/harness/console/turn-reader.test.d.ts.map +1 -0
- package/dist/lib/harness/console/turn-reader.test.js +108 -0
- package/dist/lib/harness/console/turn-reader.test.js.map +1 -0
- package/dist/lib/harness/console/types.d.ts +109 -0
- package/dist/lib/harness/console/types.d.ts.map +1 -0
- package/dist/lib/harness/console/types.js +2 -0
- package/dist/lib/harness/console/types.js.map +1 -0
- package/dist/lib/harness/contract.d.ts +229 -0
- package/dist/lib/harness/contract.d.ts.map +1 -0
- package/dist/lib/harness/contract.js +22 -0
- package/dist/lib/harness/contract.js.map +1 -0
- package/dist/lib/harness/credential.d.ts +23 -0
- package/dist/lib/harness/credential.d.ts.map +1 -0
- package/dist/lib/harness/credential.js +81 -0
- package/dist/lib/harness/credential.js.map +1 -0
- package/dist/lib/harness/credential.test.d.ts +2 -0
- package/dist/lib/harness/credential.test.d.ts.map +1 -0
- package/dist/lib/harness/credential.test.js +74 -0
- package/dist/lib/harness/credential.test.js.map +1 -0
- package/dist/lib/harness/evaluate.d.ts +390 -0
- package/dist/lib/harness/evaluate.d.ts.map +1 -0
- package/dist/lib/harness/evaluate.js +988 -0
- package/dist/lib/harness/evaluate.js.map +1 -0
- package/dist/lib/harness/evaluate.test.d.ts +2 -0
- package/dist/lib/harness/evaluate.test.d.ts.map +1 -0
- package/dist/lib/harness/evaluate.test.js +621 -0
- package/dist/lib/harness/evaluate.test.js.map +1 -0
- package/dist/lib/harness/extract.d.ts +152 -0
- package/dist/lib/harness/extract.d.ts.map +1 -0
- package/dist/lib/harness/extract.js +1601 -0
- package/dist/lib/harness/extract.js.map +1 -0
- package/dist/lib/harness/gate.d.ts +48 -0
- package/dist/lib/harness/gate.d.ts.map +1 -0
- package/dist/lib/harness/gate.js +60 -0
- package/dist/lib/harness/gate.js.map +1 -0
- package/dist/lib/harness/gate.test.d.ts +2 -0
- package/dist/lib/harness/gate.test.d.ts.map +1 -0
- package/dist/lib/harness/gate.test.js +111 -0
- package/dist/lib/harness/gate.test.js.map +1 -0
- package/dist/lib/harness/self-check.d.ts +59 -0
- package/dist/lib/harness/self-check.d.ts.map +1 -0
- package/dist/lib/harness/self-check.js +56 -0
- package/dist/lib/harness/self-check.js.map +1 -0
- package/dist/lib/harness/self-check.test.d.ts +2 -0
- package/dist/lib/harness/self-check.test.d.ts.map +1 -0
- package/dist/lib/harness/self-check.test.js +43 -0
- package/dist/lib/harness/self-check.test.js.map +1 -0
- package/dist/lib/harness/transcript.d.ts +65 -0
- package/dist/lib/harness/transcript.d.ts.map +1 -0
- package/dist/lib/harness/transcript.js +144 -0
- package/dist/lib/harness/transcript.js.map +1 -0
- package/dist/lib/harness/transcript.test.d.ts +2 -0
- package/dist/lib/harness/transcript.test.d.ts.map +1 -0
- package/dist/lib/harness/transcript.test.js +118 -0
- package/dist/lib/harness/transcript.test.js.map +1 -0
- package/dist/lib/harness-wiring.d.ts +145 -0
- package/dist/lib/harness-wiring.d.ts.map +1 -0
- package/dist/lib/harness-wiring.js +280 -0
- package/dist/lib/harness-wiring.js.map +1 -0
- package/dist/lib/hook-staleness.d.ts +95 -0
- package/dist/lib/hook-staleness.d.ts.map +1 -0
- package/dist/lib/hook-staleness.js +304 -0
- package/dist/lib/hook-staleness.js.map +1 -0
- package/dist/lib/jsonl.d.ts +270 -2
- package/dist/lib/jsonl.d.ts.map +1 -1
- package/dist/lib/jsonl.js +472 -76
- package/dist/lib/jsonl.js.map +1 -1
- package/dist/lib/memory.d.ts +350 -23
- package/dist/lib/memory.d.ts.map +1 -1
- package/dist/lib/memory.js +751 -38
- package/dist/lib/memory.js.map +1 -1
- package/dist/lib/otel-env.d.ts +90 -0
- package/dist/lib/otel-env.d.ts.map +1 -0
- package/dist/lib/otel-env.js +98 -0
- package/dist/lib/otel-env.js.map +1 -0
- package/dist/lib/project-config.d.ts +167 -0
- package/dist/lib/project-config.d.ts.map +1 -1
- package/dist/lib/project-config.js +321 -5
- package/dist/lib/project-config.js.map +1 -1
- package/dist/lib/projects-registry.d.ts +82 -0
- package/dist/lib/projects-registry.d.ts.map +1 -0
- package/dist/lib/projects-registry.js +145 -0
- package/dist/lib/projects-registry.js.map +1 -0
- package/dist/lib/projects-registry.test.d.ts +2 -0
- package/dist/lib/projects-registry.test.d.ts.map +1 -0
- package/dist/lib/projects-registry.test.js +176 -0
- package/dist/lib/projects-registry.test.js.map +1 -0
- package/dist/lib/repo-guard-scope.d.ts +126 -0
- package/dist/lib/repo-guard-scope.d.ts.map +1 -0
- package/dist/lib/repo-guard-scope.js +249 -0
- package/dist/lib/repo-guard-scope.js.map +1 -0
- package/dist/lib/report-format.d.ts +132 -0
- package/dist/lib/report-format.d.ts.map +1 -0
- package/dist/lib/report-format.js +317 -0
- package/dist/lib/report-format.js.map +1 -0
- package/dist/lib/roster.d.ts +87 -0
- package/dist/lib/roster.d.ts.map +1 -0
- package/dist/lib/roster.js +332 -0
- package/dist/lib/roster.js.map +1 -0
- package/dist/lib/roster.test.d.ts +15 -0
- package/dist/lib/roster.test.d.ts.map +1 -0
- package/dist/lib/roster.test.js +299 -0
- package/dist/lib/roster.test.js.map +1 -0
- package/dist/lib/runtime/codex-adapter.d.ts.map +1 -1
- package/dist/lib/runtime/codex-adapter.js +5 -0
- package/dist/lib/runtime/codex-adapter.js.map +1 -1
- package/dist/lib/runtime/codex-config.d.ts +129 -0
- package/dist/lib/runtime/codex-config.d.ts.map +1 -1
- package/dist/lib/runtime/codex-config.js +225 -0
- package/dist/lib/runtime/codex-config.js.map +1 -1
- package/dist/lib/runtime/identity.d.ts +72 -0
- package/dist/lib/runtime/identity.d.ts.map +1 -0
- package/dist/lib/runtime/identity.js +128 -0
- package/dist/lib/runtime/identity.js.map +1 -0
- package/dist/lib/standards.d.ts +99 -0
- package/dist/lib/standards.d.ts.map +1 -0
- package/dist/lib/standards.js +201 -0
- package/dist/lib/standards.js.map +1 -0
- package/dist/lib/team-identity.d.ts +134 -0
- package/dist/lib/team-identity.d.ts.map +1 -0
- package/dist/lib/team-identity.js +193 -0
- package/dist/lib/team-identity.js.map +1 -0
- package/dist/lib/templates.d.ts +29 -2
- package/dist/lib/templates.d.ts.map +1 -1
- package/dist/lib/templates.js +1042 -82
- package/dist/lib/templates.js.map +1 -1
- package/dist/lib/terminal-ui.d.ts.map +1 -1
- package/dist/lib/terminal-ui.js +12 -1
- package/dist/lib/terminal-ui.js.map +1 -1
- package/dist/lib/test-project.d.ts +95 -0
- package/dist/lib/test-project.d.ts.map +1 -0
- package/dist/lib/test-project.js +103 -0
- package/dist/lib/test-project.js.map +1 -0
- package/dist/lib/vault.d.ts +60 -0
- package/dist/lib/vault.d.ts.map +1 -0
- package/dist/lib/vault.js +102 -0
- package/dist/lib/vault.js.map +1 -0
- package/dist/lib/vault.test.d.ts +17 -0
- package/dist/lib/vault.test.d.ts.map +1 -0
- package/dist/lib/vault.test.js +169 -0
- package/dist/lib/vault.test.js.map +1 -0
- package/dist/lib/window-view.d.ts +63 -0
- package/dist/lib/window-view.d.ts.map +1 -0
- package/dist/lib/window-view.js +217 -0
- package/dist/lib/window-view.js.map +1 -0
- package/dist/lib/window-view.test.d.ts +2 -0
- package/dist/lib/window-view.test.d.ts.map +1 -0
- package/dist/lib/window-view.test.js +168 -0
- package/dist/lib/window-view.test.js.map +1 -0
- package/dist/lib/worktree-sync.d.ts +439 -0
- package/dist/lib/worktree-sync.d.ts.map +1 -0
- package/dist/lib/worktree-sync.js +1167 -0
- package/dist/lib/worktree-sync.js.map +1 -0
- package/dist/lib/worktree.d.ts +58 -1
- package/dist/lib/worktree.d.ts.map +1 -1
- package/dist/lib/worktree.js +91 -4
- package/dist/lib/worktree.js.map +1 -1
- package/dist/standards/decision-request.md +98 -0
- package/dist/standards/fail-loud-standard.md +495 -0
- package/dist/standards/po-communication-standard.md +126 -0
- package/dist/standards/report-format.md +128 -0
- package/dist/standards/writing-standard.md +382 -0
- package/package.json +3 -2
- package/scripts/generate-claude.mjs +119 -46
|
@@ -150,13 +150,87 @@ else
|
|
|
150
150
|
SEGMENT=$(cat "$TRANSCRIPT_PATH")
|
|
151
151
|
fi
|
|
152
152
|
|
|
153
|
-
#
|
|
154
|
-
|
|
153
|
+
# ── 3a. Subagent transcripts (#5436) ─────────────────────────────────────
|
|
154
|
+
#
|
|
155
|
+
# Claude Code writes a subagent's tool calls to its own file, never to the
|
|
156
|
+
# lead's transcript. The layout is a sibling directory of the session file:
|
|
157
|
+
#
|
|
158
|
+
# <project-dir>/<session-id>.jsonl the lead
|
|
159
|
+
# <project-dir>/<session-id>/subagents/agent-*.jsonl one per subagent
|
|
160
|
+
#
|
|
161
|
+
# So a filter over the lead's transcript alone cannot see a delegated write or a
|
|
162
|
+
# delegated commit. Measured over 5,713 real transcripts, subagents made 11,627
|
|
163
|
+
# of 12,343 repository writes (94%) against the lead's 716. That is why every
|
|
164
|
+
# auto-captured memory written between 2026-07-11 and 2026-08-13 reported
|
|
165
|
+
# "Files modified: None". Committing is delegated for the same reason, so the
|
|
166
|
+
# commit count at section 3b read 0 in 19 of 20 sampled memories.
|
|
167
|
+
#
|
|
168
|
+
# SCOPE. Exactly two fields read these files: the Write/Edit target paths below
|
|
169
|
+
# and the `git commit` count in section 3b. Nothing else does. In particular the
|
|
170
|
+
# lead's BASH_COMMANDS still feeds PR_REFS alone, because PR_REFS saves
|
|
171
|
+
# `gh pr create|merge` command lines verbatim and a `--body` argument carries
|
|
172
|
+
# prose. Widening that to subagents would put more verbatim transcript text into
|
|
173
|
+
# MemNexus, which this change deliberately does not do.
|
|
174
|
+
#
|
|
175
|
+
# The directory is absent for a session that spawned no subagent. That is the
|
|
176
|
+
# common case and not an error.
|
|
177
|
+
SUBAGENT_DIR="${TRANSCRIPT_PATH%.jsonl}/subagents"
|
|
178
|
+
SUBAGENT_FILES=()
|
|
179
|
+
if [[ -d "$SUBAGENT_DIR" ]]; then
|
|
180
|
+
# Match the lead's since-last-save window: a subagent transcript written before
|
|
181
|
+
# the previous capture was already reported by that capture. On the first
|
|
182
|
+
# capture no state file exists and every subagent file is in scope. This also
|
|
183
|
+
# bounds the read, which matters because this hook fires on every Stop.
|
|
184
|
+
_mx_newer=()
|
|
185
|
+
[[ -f "$STATE_FILE" ]] && _mx_newer=(-newer "$STATE_FILE")
|
|
186
|
+
# STATED CAP, not a silent one. The largest subagent count in the fleet's 301
|
|
187
|
+
# real sessions is 189, so 200 is above the observed range. A session past the
|
|
188
|
+
# cap reports the first 200 files and undercounts the rest.
|
|
189
|
+
while IFS= read -r _mx_f; do
|
|
190
|
+
[[ -n "$_mx_f" ]] && SUBAGENT_FILES+=("$_mx_f")
|
|
191
|
+
done < <(find "$SUBAGENT_DIR" -maxdepth 1 -type f -name 'agent-*.jsonl' \
|
|
192
|
+
"${_mx_newer[@]}" 2>/dev/null \
|
|
193
|
+
| head -n "${AUTO_CAPTURE_MAX_SUBAGENTS:-200}")
|
|
194
|
+
fi
|
|
195
|
+
|
|
196
|
+
# `-R` with `fromjson?` skips a malformed line instead of aborting the whole
|
|
197
|
+
# extraction. The lead's path below keeps plain `jq -r`, which aborts; that is
|
|
198
|
+
# left as it was. This path reads many files at once, so one bad line in one of
|
|
199
|
+
# them must not empty the result. The archive holds 15 unparseable lines across
|
|
200
|
+
# 5,713 files, which makes that a real case rather than a hypothetical one.
|
|
201
|
+
SUBAGENT_WRITES=""
|
|
202
|
+
if (( ${#SUBAGENT_FILES[@]} > 0 )); then
|
|
203
|
+
SUBAGENT_WRITES=$(jq -R -r 'fromjson? // empty |
|
|
204
|
+
select(.type == "assistant") |
|
|
205
|
+
.message.content[]? |
|
|
206
|
+
select(.type == "tool_use" and (.name == "Write" or .name == "Edit")) |
|
|
207
|
+
.input.file_path // empty
|
|
208
|
+
' "${SUBAGENT_FILES[@]}" 2>/dev/null || true)
|
|
209
|
+
fi
|
|
210
|
+
|
|
211
|
+
# Files modified in this segment, by the lead and by its subagents
|
|
212
|
+
LEAD_WRITES=$(echo "$SEGMENT" | jq -r '
|
|
155
213
|
select(.type == "assistant") |
|
|
156
214
|
.message.content[]? |
|
|
157
215
|
select(.type == "tool_use" and (.name == "Write" or .name == "Edit")) |
|
|
158
216
|
.input.file_path // empty
|
|
159
|
-
' 2>/dev/null | grep -v '^$'
|
|
217
|
+
' 2>/dev/null | grep -v '^$' || true)
|
|
218
|
+
|
|
219
|
+
_MX_ALL_WRITES=$(printf '%s\n%s\n' "$LEAD_WRITES" "$SUBAGENT_WRITES" \
|
|
220
|
+
| grep -v '^$' | sort -u)
|
|
221
|
+
|
|
222
|
+
# Repository paths first, scratchpad paths after, one shared cap of 20.
|
|
223
|
+
#
|
|
224
|
+
# Ordering matters now that subagent writes are in scope. A fifth of subagent
|
|
225
|
+
# writes target a scratchpad under /tmp/claude-1000/<project>/<session>/, and
|
|
226
|
+
# "/tmp" sorts ahead of "/workspace", so a plain `sort -u | head -20` filled the
|
|
227
|
+
# list with temporary files and dropped every repository path. The field would
|
|
228
|
+
# have stopped saying "None" while still not naming the work. This reorders one
|
|
229
|
+
# list; it captures no path it did not already capture, and the cap is the
|
|
230
|
+
# same 20 as before.
|
|
231
|
+
FILES_MODIFIED=$( { printf '%s\n' "$_MX_ALL_WRITES" | grep -v '^/tmp/' || true; \
|
|
232
|
+
printf '%s\n' "$_MX_ALL_WRITES" | grep '^/tmp/' || true; } \
|
|
233
|
+
| grep -v '^$' | head -20)
|
|
160
234
|
|
|
161
235
|
# Tool call count
|
|
162
236
|
TOOL_COUNT=$(echo "$SEGMENT" | jq -r '
|
|
@@ -180,7 +254,35 @@ BASH_COMMANDS=$(echo "$SEGMENT" | jq -r '
|
|
|
180
254
|
.input.command // empty
|
|
181
255
|
' 2>/dev/null)
|
|
182
256
|
|
|
183
|
-
|
|
257
|
+
# ── 3b. Commit count (#5436) ─────────────────────────────────────────────
|
|
258
|
+
#
|
|
259
|
+
# The line this replaces had two defects. It counted only the lead's Bash calls,
|
|
260
|
+
# and committing is usually delegated, so 19 of 20 sampled memories reported 0.
|
|
261
|
+
# And `grep -c` prints its count AND exits 1 when nothing matches, so the old
|
|
262
|
+
# `|| echo "0"` fired as well and the variable became two lines. That is the
|
|
263
|
+
# doubled "0" every one of those memories rendered.
|
|
264
|
+
#
|
|
265
|
+
# `|| true` keeps the assignment off the ERR trap installed at the top of this
|
|
266
|
+
# file without adding a second line: grep has already printed its count.
|
|
267
|
+
#
|
|
268
|
+
# SUBAGENT_BASH is counted and never saved. No command text from it reaches the
|
|
269
|
+
# memory: PR_REFS below reads the lead's BASH_COMMANDS only.
|
|
270
|
+
GIT_COMMITS_LEAD=$(printf '%s\n' "$BASH_COMMANDS" | grep -cE 'git commit' 2>/dev/null || true)
|
|
271
|
+
|
|
272
|
+
SUBAGENT_BASH=""
|
|
273
|
+
if (( ${#SUBAGENT_FILES[@]} > 0 )); then
|
|
274
|
+
SUBAGENT_BASH=$(jq -R -r 'fromjson? // empty |
|
|
275
|
+
select(.type == "assistant") |
|
|
276
|
+
.message.content[]? |
|
|
277
|
+
select(.type == "tool_use" and .name == "Bash") |
|
|
278
|
+
.input.command // empty
|
|
279
|
+
' "${SUBAGENT_FILES[@]}" 2>/dev/null || true)
|
|
280
|
+
fi
|
|
281
|
+
GIT_COMMITS_SUB=$(printf '%s\n' "$SUBAGENT_BASH" | grep -cE 'git commit' 2>/dev/null || true)
|
|
282
|
+
|
|
283
|
+
[[ "$GIT_COMMITS_LEAD" =~ ^[0-9]+$ ]] || GIT_COMMITS_LEAD=0
|
|
284
|
+
[[ "$GIT_COMMITS_SUB" =~ ^[0-9]+$ ]] || GIT_COMMITS_SUB=0
|
|
285
|
+
GIT_COMMITS=$(( GIT_COMMITS_LEAD + GIT_COMMITS_SUB ))
|
|
184
286
|
PR_REFS=$(echo "$BASH_COMMANDS" | grep -oE 'gh pr (create|merge) [^\n]*' 2>/dev/null | head -5)
|
|
185
287
|
|
|
186
288
|
# PR and issue references. Extracted in a pipeline so the raw transcript text is
|
|
@@ -244,14 +346,103 @@ fi
|
|
|
244
346
|
# Truncate
|
|
245
347
|
CONTENT=$(echo "$CONTENT" | head -c 5000)
|
|
246
348
|
|
|
247
|
-
# ──
|
|
349
|
+
# ── 5. Verbatim-transcript guard (fail-closed, fail-loud) ───────────────
|
|
350
|
+
#
|
|
351
|
+
# SCOPE — TEXT BLOCKS ONLY. This guard re-extracts
|
|
352
|
+
# `.message.content[] | select(.type == "text")`, the same selector the removed
|
|
353
|
+
# capture used, and refuses the save if any of that prose reached $CONTENT. It
|
|
354
|
+
# does NOT re-extract tool_use inputs, tool_result content, or thinking blocks.
|
|
355
|
+
# It is therefore NOT a general backstop against transcript material reaching
|
|
356
|
+
# MemNexus — it enforces one specific removal. Material captured from any other
|
|
357
|
+
# part of the transcript passes it untouched, by design.
|
|
358
|
+
#
|
|
359
|
+
# In THIS file that exclusion is load-bearing: PR_REFS (line 101) captures
|
|
360
|
+
# `gh pr create|merge` command lines verbatim from tool_use inputs and they are
|
|
361
|
+
# saved under "PR activity". This guard does not see them. Tracked in #4837.
|
|
362
|
+
#
|
|
363
|
+
# It is NOT a redactor either. A keyword redactor cannot catch prose that
|
|
364
|
+
# restates a secret in a sentence, which is exactly the shape this hook was
|
|
365
|
+
# leaking, so the capture was removed and this verifies the removal held.
|
|
366
|
+
#
|
|
367
|
+
# If the check itself cannot run, it refuses too. A save never proceeds
|
|
368
|
+
# unverified, and every refusal is announced on stderr.
|
|
369
|
+
# Returns 0 = safe to save, 1 = do not save.
|
|
370
|
+
mx_verbatim_guard() {
|
|
371
|
+
local transcript="$1" content="$2" prose pat
|
|
372
|
+
local tag="[auto-capture-session-end] BLOCKED: memory NOT saved —"
|
|
373
|
+
|
|
374
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
375
|
+
echo "$tag jq unavailable, cannot verify transcript text was excluded" >&2
|
|
376
|
+
return 1
|
|
377
|
+
fi
|
|
378
|
+
if [[ ! -r "$transcript" ]]; then
|
|
379
|
+
echo "$tag transcript unreadable, cannot verify" >&2
|
|
380
|
+
return 1
|
|
381
|
+
fi
|
|
382
|
+
|
|
383
|
+
prose=$(mktemp) || { echo "$tag mktemp failed, cannot verify" >&2; return 1; }
|
|
384
|
+
pat=$(mktemp) || { rm -f "$prose"; echo "$tag mktemp failed, cannot verify" >&2; return 1; }
|
|
385
|
+
|
|
386
|
+
# `-R` + `fromjson?` parses each JSONL line independently: a malformed line is
|
|
387
|
+
# skipped rather than aborting the extraction. Parity holds for the PROSE path
|
|
388
|
+
# by construction — GH_REFS above uses this identical parser, so a line this
|
|
389
|
+
# guard skips is a line the prose/reference capture skipped too. The claim is
|
|
390
|
+
# limited to that path: FILES_MODIFIED, TOOL_COUNT and BASH_COMMANDS
|
|
391
|
+
# (lines 71-98) use plain `jq -r`, a
|
|
392
|
+
# different mode that aborts on a malformed line instead of skipping it. Those
|
|
393
|
+
# extract no text blocks, so they fall outside what this guard checks anyway.
|
|
394
|
+
if ! jq -R -r 'fromjson? // empty |
|
|
395
|
+
select(.type == "user" or .type == "assistant") |
|
|
396
|
+
.message.content |
|
|
397
|
+
if type == "array" then [.[] | select(.type == "text") | .text // empty] | join("\n")
|
|
398
|
+
elif type == "string" then .
|
|
399
|
+
else empty end' "$transcript" > "$prose" 2>/dev/null; then
|
|
400
|
+
rm -f "$prose" "$pat"
|
|
401
|
+
echo "$tag transcript prose extraction failed, cannot verify" >&2
|
|
402
|
+
return 1
|
|
403
|
+
fi
|
|
404
|
+
|
|
405
|
+
# Candidate prose lines: long enough and sentence-shaped. Short structured
|
|
406
|
+
# tokens (a `#4804` reference, a bare file path) are deliberately captured and
|
|
407
|
+
# are not free text, so they are not candidates.
|
|
408
|
+
awk 'length($0) >= 40 && index($0, " ") > 0' "$prose" | head -5000 > "$pat"
|
|
409
|
+
|
|
410
|
+
if [[ -s "$pat" ]] && grep -F -q -f "$pat" <<< "$content"; then
|
|
411
|
+
rm -f "$prose" "$pat"
|
|
412
|
+
echo "$tag assembled content still contains verbatim transcript prose" >&2
|
|
413
|
+
return 1
|
|
414
|
+
fi
|
|
415
|
+
|
|
416
|
+
rm -f "$prose" "$pat"
|
|
417
|
+
return 0
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
# ── 5b. Resolve project scope (codeContext) ──────────────────────────────
|
|
421
|
+
#
|
|
422
|
+
# BACKPORT. The block below is the "Resolve project scope" block of
|
|
423
|
+
# @memnexus-ai/cli@1.7.235, hooks/capture-session-end.sh lines 240 to 493, copied byte
|
|
424
|
+
# for byte apart from the three points this note names. Product owner ruling,
|
|
425
|
+
# 2026-08-22 (AskUserQuestion): "Approve both halves in v5" (plan #67, fixes #62).
|
|
426
|
+
#
|
|
427
|
+
# WHERE THIS FORK DIFFERS FROM UPSTREAM:
|
|
428
|
+
# 1. Section number. Upstream numbers the block 6b. This file's guard is
|
|
429
|
+
# section 5 and its save is section 6, so the block is 5b here. Its
|
|
430
|
+
# position is the same: after the content is built, before the create call.
|
|
431
|
+
# 2. The trap paragraph below names section 3, which is where THIS file arms
|
|
432
|
+
# `trap 'rm -rf "$tmpdir"; _mxht_emit || :; exit 0' EXIT ERR`.
|
|
433
|
+
# Upstream names its own section 5.
|
|
434
|
+
# 3. The create call keeps this fork's `timeout "${AUTO_CAPTURE_TIMEOUT_SECS:-20}"` and
|
|
435
|
+
# `|| true`, not upstream's TIMEOUT_CMD and CREATE_STATUS reporting. The one
|
|
436
|
+
# addition is the --code-context argument.
|
|
437
|
+
#
|
|
438
|
+
# auto-checkpoint.sh gets none of this. It writes a NAMED memory, and scope must
|
|
439
|
+
# not reach that path until memnexus#5470 is resolved (#62).
|
|
440
|
+
#
|
|
441
|
+
# ── upstream block, verbatim from here ──
|
|
248
442
|
# Auto-captured memories carried no scope at all, so they leaked into every
|
|
249
443
|
# team's scoped searches and polluted build_context (#5158, #4957). PR #3281
|
|
250
444
|
# fixed that for the commit path only; this is the same resolution for the
|
|
251
|
-
# capture hooks, using the same sources and the same precedence.
|
|
252
|
-
# the reviewed customer hook cli/hooks/capture-session-end.sh — port from that
|
|
253
|
-
# file's FINAL state, not from an earlier draft: two of the properties below
|
|
254
|
-
# were blocking security findings.
|
|
445
|
+
# capture hooks, using the same sources and the same precedence.
|
|
255
446
|
#
|
|
256
447
|
# Mirrors resolveCommitCodeContext() in cli/src/lib/commit-context/code-context.ts:
|
|
257
448
|
# 1. MX_CODE_CONTEXT env var — operator-controlled, higher trust. It wins over
|
|
@@ -273,8 +464,6 @@ CODE_CONTEXT_MAX_BYTES=65536
|
|
|
273
464
|
# cli/src/lib/commit-context/local-cache.ts. `-e`, not `-d`: inside a git
|
|
274
465
|
# worktree `.git` is a FILE, and the worktree root — not the main repo — is the
|
|
275
466
|
# project root (the TS uses fs.existsSync, which makes no such distinction).
|
|
276
|
-
# In the fleet this is the ONLY case that occurs: every agent works in a
|
|
277
|
-
# worktree, so `-d` would silently resolve no scope on every machine.
|
|
278
467
|
find_project_root() { # <start-dir> -> project root on stdout, or nothing
|
|
279
468
|
local dir
|
|
280
469
|
dir=$(cd "$1" 2>/dev/null && pwd -P) || return 0
|
|
@@ -313,7 +502,7 @@ find_project_root() { # <start-dir> -> project root on stdout, or nothing
|
|
|
313
502
|
# exceeds 2 UTF-16 units, 100 codepoints can never exceed 200 units. Scope
|
|
314
503
|
# labels are short names (product/team/service); the extra truncation is
|
|
315
504
|
# unreachable in practice, and truncating is recoverable where a rejected
|
|
316
|
-
# request is not.
|
|
505
|
+
# request is not.
|
|
317
506
|
normalize_code_context() { # JSON on stdin -> normalized JSON object, or nothing
|
|
318
507
|
local out
|
|
319
508
|
out=$(jq -s -c '
|
|
@@ -358,6 +547,15 @@ if [[ -z "$CODE_CONTEXT_JSON" ]]; then
|
|
|
358
547
|
# {"product":"home","team":"DOTFILES-WRONG-SCOPE"} from the $HOME config.
|
|
359
548
|
# The loop below consults the next source instead, which `:-` cannot express.
|
|
360
549
|
#
|
|
550
|
+
# WHAT IS ACTUALLY KNOWN ABOUT CLAUDE_PROJECT_DIR IN THE CUSTOMER CONTEXT.
|
|
551
|
+
# It is the documented hook variable, and it is the right first source when it
|
|
552
|
+
# is present. This repo does NOT evidence that it is set for hooks installed
|
|
553
|
+
# by `mx mcp install`: every other reference to it is fleet code, and it was
|
|
554
|
+
# measured UNSET in a live Claude Code tool process (a tool process is not a
|
|
555
|
+
# hook process, so that is not disproof — but it is not confirmation either).
|
|
556
|
+
# The expression below is therefore designed to be CORRECT WHEN IT IS ABSENT:
|
|
557
|
+
# an unset or empty value is skipped by the loop and the cwd carries the case.
|
|
558
|
+
# Do not restructure this so that a present CLAUDE_PROJECT_DIR is required.
|
|
361
559
|
# WHY THE TRANSCRIPT DIRECTORY IS NOT A SOURCE. It has no legitimate resolving
|
|
362
560
|
# power, and the reason is DEPTH-INDEPENDENT — do not restate it as a claim
|
|
363
561
|
# about the transcript's nesting. An earlier version of this comment argued
|
|
@@ -450,10 +648,12 @@ if [[ -z "$CODE_CONTEXT_JSON" ]]; then
|
|
|
450
648
|
CC_FILE="${CC_ROOT}/.mx-code-context.json"
|
|
451
649
|
if [[ -n "$CC_ROOT" ]]; then
|
|
452
650
|
# CWE-59. `-f`, `-r` and the read all follow symlinks, so a repo could check
|
|
453
|
-
# in `.mx-code-context.json` as a symlink to any file on the machine
|
|
454
|
-
# six allowlisted keys of it would be uploaded to
|
|
455
|
-
# and require the result to stay inside
|
|
456
|
-
#
|
|
651
|
+
# in `.mx-code-context.json` as a symlink to any file on the user's machine
|
|
652
|
+
# and the six allowlisted keys of it would be uploaded to the user's own
|
|
653
|
+
# MemNexus account. Resolve the path and require the result to stay inside
|
|
654
|
+
# the project root — the containment this same hook already applies to the
|
|
655
|
+
# transcript path in section 2. Read through the RESOLVED path, so the link
|
|
656
|
+
# is not traversed a second time.
|
|
457
657
|
CC_REAL=$(realpath "$CC_FILE" 2>/dev/null || printf '')
|
|
458
658
|
if [[ -n "$CC_REAL" && "$CC_REAL" == "$CC_ROOT"/* && -f "$CC_REAL" && -r "$CC_REAL" ]]; then
|
|
459
659
|
# One open, bounded at the source (same 64KB bound as the TS resolver).
|
|
@@ -493,77 +693,6 @@ if [[ -n "$CODE_CONTEXT_JSON" ]]; then
|
|
|
493
693
|
CODE_CONTEXT_ARGS=(--code-context "$CODE_CONTEXT_JSON")
|
|
494
694
|
fi
|
|
495
695
|
|
|
496
|
-
# ── 5. Verbatim-transcript guard (fail-closed, fail-loud) ───────────────
|
|
497
|
-
#
|
|
498
|
-
# SCOPE — TEXT BLOCKS ONLY. This guard re-extracts
|
|
499
|
-
# `.message.content[] | select(.type == "text")`, the same selector the removed
|
|
500
|
-
# capture used, and refuses the save if any of that prose reached $CONTENT. It
|
|
501
|
-
# does NOT re-extract tool_use inputs, tool_result content, or thinking blocks.
|
|
502
|
-
# It is therefore NOT a general backstop against transcript material reaching
|
|
503
|
-
# MemNexus — it enforces one specific removal. Material captured from any other
|
|
504
|
-
# part of the transcript passes it untouched, by design.
|
|
505
|
-
#
|
|
506
|
-
# In THIS file that exclusion is load-bearing: PR_REFS (line 101) captures
|
|
507
|
-
# `gh pr create|merge` command lines verbatim from tool_use inputs and they are
|
|
508
|
-
# saved under "PR activity". This guard does not see them. Tracked in #4837.
|
|
509
|
-
#
|
|
510
|
-
# It is NOT a redactor either. A keyword redactor cannot catch prose that
|
|
511
|
-
# restates a secret in a sentence, which is exactly the shape this hook was
|
|
512
|
-
# leaking, so the capture was removed and this verifies the removal held.
|
|
513
|
-
#
|
|
514
|
-
# If the check itself cannot run, it refuses too. A save never proceeds
|
|
515
|
-
# unverified, and every refusal is announced on stderr.
|
|
516
|
-
# Returns 0 = safe to save, 1 = do not save.
|
|
517
|
-
mx_verbatim_guard() {
|
|
518
|
-
local transcript="$1" content="$2" prose pat
|
|
519
|
-
local tag="[auto-capture-session-end] BLOCKED: memory NOT saved —"
|
|
520
|
-
|
|
521
|
-
if ! command -v jq >/dev/null 2>&1; then
|
|
522
|
-
echo "$tag jq unavailable, cannot verify transcript text was excluded" >&2
|
|
523
|
-
return 1
|
|
524
|
-
fi
|
|
525
|
-
if [[ ! -r "$transcript" ]]; then
|
|
526
|
-
echo "$tag transcript unreadable, cannot verify" >&2
|
|
527
|
-
return 1
|
|
528
|
-
fi
|
|
529
|
-
|
|
530
|
-
prose=$(mktemp) || { echo "$tag mktemp failed, cannot verify" >&2; return 1; }
|
|
531
|
-
pat=$(mktemp) || { rm -f "$prose"; echo "$tag mktemp failed, cannot verify" >&2; return 1; }
|
|
532
|
-
|
|
533
|
-
# `-R` + `fromjson?` parses each JSONL line independently: a malformed line is
|
|
534
|
-
# skipped rather than aborting the extraction. Parity holds for the PROSE path
|
|
535
|
-
# by construction — GH_REFS above uses this identical parser, so a line this
|
|
536
|
-
# guard skips is a line the prose/reference capture skipped too. The claim is
|
|
537
|
-
# limited to that path: FILES_MODIFIED, TOOL_COUNT and BASH_COMMANDS
|
|
538
|
-
# (lines 71-98) use plain `jq -r`, a
|
|
539
|
-
# different mode that aborts on a malformed line instead of skipping it. Those
|
|
540
|
-
# extract no text blocks, so they fall outside what this guard checks anyway.
|
|
541
|
-
if ! jq -R -r 'fromjson? // empty |
|
|
542
|
-
select(.type == "user" or .type == "assistant") |
|
|
543
|
-
.message.content |
|
|
544
|
-
if type == "array" then [.[] | select(.type == "text") | .text // empty] | join("\n")
|
|
545
|
-
elif type == "string" then .
|
|
546
|
-
else empty end' "$transcript" > "$prose" 2>/dev/null; then
|
|
547
|
-
rm -f "$prose" "$pat"
|
|
548
|
-
echo "$tag transcript prose extraction failed, cannot verify" >&2
|
|
549
|
-
return 1
|
|
550
|
-
fi
|
|
551
|
-
|
|
552
|
-
# Candidate prose lines: long enough and sentence-shaped. Short structured
|
|
553
|
-
# tokens (a `#4804` reference, a bare file path) are deliberately captured and
|
|
554
|
-
# are not free text, so they are not candidates.
|
|
555
|
-
awk 'length($0) >= 40 && index($0, " ") > 0' "$prose" | head -5000 > "$pat"
|
|
556
|
-
|
|
557
|
-
if [[ -s "$pat" ]] && grep -F -q -f "$pat" <<< "$content"; then
|
|
558
|
-
rm -f "$prose" "$pat"
|
|
559
|
-
echo "$tag assembled content still contains verbatim transcript prose" >&2
|
|
560
|
-
return 1
|
|
561
|
-
fi
|
|
562
|
-
|
|
563
|
-
rm -f "$prose" "$pat"
|
|
564
|
-
return 0
|
|
565
|
-
}
|
|
566
|
-
|
|
567
696
|
# ── 6. Save memory ──────────────────────────────────────────────────────
|
|
568
697
|
if mx_verbatim_guard "$TRANSCRIPT_PATH" "$CONTENT"; then
|
|
569
698
|
# Bounded: network write. On timeout we land on the existing `|| true` path —
|
|
@@ -44,14 +44,67 @@ command -v mx >/dev/null 2>&1 || exit 0
|
|
|
44
44
|
# captured deliberately and are not free text; the point is that the guard's
|
|
45
45
|
# silence about them is a scope limit, not evidence they are safe.
|
|
46
46
|
|
|
47
|
-
#
|
|
48
|
-
|
|
47
|
+
# Subagent transcripts (#5436)
|
|
48
|
+
#
|
|
49
|
+
# A subagent's tool calls are written to its own file, never to the lead's
|
|
50
|
+
# transcript:
|
|
51
|
+
#
|
|
52
|
+
# <project-dir>/<session-id>.jsonl the lead
|
|
53
|
+
# <project-dir>/<session-id>/subagents/agent-*.jsonl one per subagent
|
|
54
|
+
#
|
|
55
|
+
# Subagents made 11,627 of 12,343 repository writes (94%) across 5,713 measured
|
|
56
|
+
# transcripts, so a checkpoint built from the lead alone names few of the files
|
|
57
|
+
# the session actually touched. Only file paths are read here, which is what
|
|
58
|
+
# this hook already captures.
|
|
59
|
+
#
|
|
60
|
+
# RECENCY, matching the lead's `tail -500`: take the most recently written
|
|
61
|
+
# subagent transcripts and the last 500 lines of each. A checkpoint answers
|
|
62
|
+
# "what was I just doing", so the newest work is the part worth keeping.
|
|
63
|
+
#
|
|
64
|
+
# STATED CAP, not a silent one. 20 files at 500 lines bounds the read; the
|
|
65
|
+
# fleet's largest session has 189 subagent transcripts, so a busy session
|
|
66
|
+
# contributes its 20 most recent and not the rest.
|
|
67
|
+
SUBAGENT_DIR="${TRANSCRIPT_PATH%.jsonl}/subagents"
|
|
68
|
+
SUBAGENT_TOUCHED=""
|
|
69
|
+
if [[ -d "$SUBAGENT_DIR" ]]; then
|
|
70
|
+
_mx_files=()
|
|
71
|
+
while IFS= read -r _mx_f; do
|
|
72
|
+
[[ -n "$_mx_f" ]] && _mx_files+=("$SUBAGENT_DIR/$_mx_f")
|
|
73
|
+
done < <(ls -1t "$SUBAGENT_DIR" 2>/dev/null | grep -E '^agent-.*[.]jsonl$' \
|
|
74
|
+
| head -n "${AUTO_CHECKPOINT_MAX_SUBAGENTS:-20}")
|
|
75
|
+
if (( ${#_mx_files[@]} > 0 )); then
|
|
76
|
+
# `-R` with `fromjson?` skips a malformed line rather than aborting the whole
|
|
77
|
+
# extraction, which matters when reading many files at once.
|
|
78
|
+
SUBAGENT_TOUCHED=$(for _mx_f in "${_mx_files[@]}"; do tail -500 "$_mx_f" 2>/dev/null; done \
|
|
79
|
+
| jq -R -r 'fromjson? // empty |
|
|
80
|
+
select(.type == "assistant") |
|
|
81
|
+
.message.content[]? |
|
|
82
|
+
select(.type == "tool_use") |
|
|
83
|
+
.input.file_path // empty
|
|
84
|
+
' 2>/dev/null || true)
|
|
85
|
+
fi
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
# Files touched (from tool_use entries: Read, Edit, Write, Glob), by the lead
|
|
89
|
+
# and by its subagents
|
|
90
|
+
LEAD_TOUCHED=$(tail -500 "$TRANSCRIPT_PATH" | \
|
|
49
91
|
jq -r '
|
|
50
92
|
select(.type == "assistant") |
|
|
51
93
|
.message.content[]? |
|
|
52
94
|
select(.type == "tool_use") |
|
|
53
95
|
.input.file_path // empty
|
|
54
|
-
' 2>/dev/null | grep -v '^$'
|
|
96
|
+
' 2>/dev/null | grep -v '^$' || true)
|
|
97
|
+
|
|
98
|
+
_MX_ALL_TOUCHED=$(printf '%s\n%s\n' "$LEAD_TOUCHED" "$SUBAGENT_TOUCHED" \
|
|
99
|
+
| grep -v '^$' | sort -u)
|
|
100
|
+
|
|
101
|
+
# Repository paths first, scratchpad paths after, one shared cap of 30. "/tmp"
|
|
102
|
+
# sorts ahead of "/workspace", so a plain sort would fill the list with
|
|
103
|
+
# temporary files and drop the repository paths a resuming session needs.
|
|
104
|
+
# Nothing new is captured; one list is reordered and the cap is unchanged.
|
|
105
|
+
FILES_TOUCHED=$( { printf '%s\n' "$_MX_ALL_TOUCHED" | grep -v '^/tmp/' || true; \
|
|
106
|
+
printf '%s\n' "$_MX_ALL_TOUCHED" | grep '^/tmp/' || true; } \
|
|
107
|
+
| grep -v '^$' | head -30)
|
|
55
108
|
|
|
56
109
|
# Git branch and PR references
|
|
57
110
|
GIT_BRANCH="${CLAUDE_WORKTREE_BRANCH:-}"
|
|
@@ -74,10 +127,27 @@ WORKTREE_NAME="${CLAUDE_WORKTREE_NAME:-unknown}"
|
|
|
74
127
|
|
|
75
128
|
# ── 3. Format checkpoint memory ─────────────────────────────────────────
|
|
76
129
|
|
|
77
|
-
# Build files list
|
|
130
|
+
# Build files list, one bare path per line
|
|
131
|
+
#
|
|
132
|
+
# NO "- " BULLET, AND THAT IS LOAD-BEARING (#5436). Section 4's guard treats a
|
|
133
|
+
# transcript line as prose when it is at least 40 characters and contains a
|
|
134
|
+
# space, then refuses the save if any such line appears in the assembled
|
|
135
|
+
# content. Assistants routinely write bulleted path lists in their own prose:
|
|
136
|
+
#
|
|
137
|
+
# - /workspace/.worktrees/marketing-20260313/marketing-site/app/globals.css
|
|
138
|
+
#
|
|
139
|
+
# Rendering the same path with the same "- " prefix reproduces that line
|
|
140
|
+
# exactly, so the guard matched and the checkpoint was refused. Measured on the
|
|
141
|
+
# 20-session sample in the pull request, that silently dropped 2 checkpoints
|
|
142
|
+
# once subagent paths widened this list.
|
|
143
|
+
#
|
|
144
|
+
# A bare path cannot collide: it contains no space, so it can never qualify as
|
|
145
|
+
# a candidate pattern, and the bulleted form of it is not a substring of this
|
|
146
|
+
# content. This changes how the list renders and changes nothing about which
|
|
147
|
+
# paths are captured. The guard itself is untouched.
|
|
78
148
|
FILES_LIST=""
|
|
79
149
|
if [[ -n "$FILES_TOUCHED" ]]; then
|
|
80
|
-
FILES_LIST
|
|
150
|
+
FILES_LIST="$FILES_TOUCHED"
|
|
81
151
|
fi
|
|
82
152
|
|
|
83
153
|
CONTENT="[Auto-Checkpoint] Context compaction (${TRIGGER}) — ${WORKTREE_NAME}
|