@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
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* standards.ts — read the framework's writing standard and report format, and
|
|
3
|
+
* render them for injection into every conversation turn.
|
|
4
|
+
*
|
|
5
|
+
* PROBLEM. The style rules this project runs on existed in one person's memory
|
|
6
|
+
* and in corrections made during conversation. Every new agent rediscovered
|
|
7
|
+
* them by being corrected, and the corrections cost a turn each. The report
|
|
8
|
+
* format did not exist at all, so 25 of 28 moments where an agent needed a
|
|
9
|
+
* decision went out as prose into a channel nobody reads
|
|
10
|
+
* (`docs/fleet-behavior-from-transcripts.md` finding 3c).
|
|
11
|
+
*
|
|
12
|
+
* WHY INJECTION RATHER THAN A FILE. `product/mx-agent-prd.md:268` records the
|
|
13
|
+
* pattern this repository already measured: when we built a mechanism, teams
|
|
14
|
+
* followed the practice, and when we only wrote a rule, they stopped. The
|
|
15
|
+
* correction-of-errors requirement lived in process documents as an
|
|
16
|
+
* instruction, and 16 required records were never filed. A standard read once
|
|
17
|
+
* at session start is that same shape. So these two documents go into
|
|
18
|
+
* `CLAUDE.local.md`, which the runtime re-reads on every turn.
|
|
19
|
+
*
|
|
20
|
+
* THE BLOCKS ARE MARKED, NOT WHOLE FILES. Each standard carries the same
|
|
21
|
+
* `<!-- behavioral-start -->` markers a roleguide uses, and only the marked
|
|
22
|
+
* block is injected. That is deliberate reuse: `extractMarkerBlock` already
|
|
23
|
+
* enforces exactly one marker pair, a non-empty block, a byte ceiling, and no
|
|
24
|
+
* control characters, and every one of those failures is a real way to poison
|
|
25
|
+
* per-turn context. It also means the documents can hold worked examples and
|
|
26
|
+
* git history without paying for them on every turn.
|
|
27
|
+
*
|
|
28
|
+
* FAILURE MODEL — loud, named, FAIL-OPEN. A standard that cannot be read is a
|
|
29
|
+
* real degradation and is not a reason to refuse a session. It is the same tier
|
|
30
|
+
* as the behavioral block in `claude.ts`: warn once, name the file and the
|
|
31
|
+
* problem, continue. The fail-closed control for this pair is
|
|
32
|
+
* `mx-agent report check`, which refuses a report rather than a session.
|
|
33
|
+
*/
|
|
34
|
+
import { existsSync, readFileSync, statSync } from 'fs';
|
|
35
|
+
import { dirname, join } from 'path';
|
|
36
|
+
import { fileURLToPath } from 'url';
|
|
37
|
+
import { extractMarkerBlock, sanitizeForMessage } from './behavioral-injection.js';
|
|
38
|
+
/**
|
|
39
|
+
* Files read from the standards directory, in the order they are injected.
|
|
40
|
+
*
|
|
41
|
+
* `po-communication-standard.md` is first because it overrides the writing
|
|
42
|
+
* standard and the report format for messages addressed to the product owner,
|
|
43
|
+
* and a reader has to meet the override before the rules it overrides.
|
|
44
|
+
*/
|
|
45
|
+
export const INJECTED_STANDARDS = [
|
|
46
|
+
{ file: 'po-communication-standard.md', title: 'How to talk to the product owner' },
|
|
47
|
+
{ file: 'writing-standard.md', title: 'Writing standard' },
|
|
48
|
+
{ file: 'report-format.md', title: 'Report format' },
|
|
49
|
+
{ file: 'decision-request.md', title: 'Decision request' },
|
|
50
|
+
];
|
|
51
|
+
/** Bytes the rendered block may reach before it is dropped rather than injected. */
|
|
52
|
+
export const MAX_STANDARDS_BLOCK_BYTES = 16 * 1024;
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the directory holding the shipped standards.
|
|
55
|
+
*
|
|
56
|
+
* Order, mirroring `bundled-config.ts`:
|
|
57
|
+
* 1. `MX_STANDARDS_DIR` — test seam and power-user override
|
|
58
|
+
* 2. `<cliDist>/standards/` — the copy bundled into the package
|
|
59
|
+
* 3. `<repoRoot>/mx-agent-system/standards/` — dev and monorepo fallback
|
|
60
|
+
*
|
|
61
|
+
* TRUST BOUNDARY. Whatever the override points at is injected verbatim into
|
|
62
|
+
* every turn of every team. Set it only to a directory you control.
|
|
63
|
+
*/
|
|
64
|
+
export function getStandardsDir() {
|
|
65
|
+
const override = process.env.MX_STANDARDS_DIR;
|
|
66
|
+
if (override && existsSync(join(override, INJECTED_STANDARDS[0].file)))
|
|
67
|
+
return override;
|
|
68
|
+
const here = dirname(fileURLToPath(import.meta.url)); // dist/lib or src/lib
|
|
69
|
+
const bundled = join(here, '..', 'standards');
|
|
70
|
+
if (existsSync(join(bundled, INJECTED_STANDARDS[0].file)))
|
|
71
|
+
return bundled;
|
|
72
|
+
let dir = here;
|
|
73
|
+
for (let i = 0; i < 20; i += 1) {
|
|
74
|
+
const guess = join(dir, 'mx-agent-system', 'standards');
|
|
75
|
+
if (existsSync(join(guess, INJECTED_STANDARDS[0].file)))
|
|
76
|
+
return guess;
|
|
77
|
+
const parent = dirname(dir);
|
|
78
|
+
if (parent === dir)
|
|
79
|
+
break;
|
|
80
|
+
dir = parent;
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
/** Read one standard and extract its marked block. Never throws. */
|
|
85
|
+
export function readStandardBlock(dir, file, title) {
|
|
86
|
+
const path = join(dir, file);
|
|
87
|
+
const base = { file, title };
|
|
88
|
+
let raw;
|
|
89
|
+
try {
|
|
90
|
+
const stat = statSync(path);
|
|
91
|
+
if (!stat.isFile()) {
|
|
92
|
+
return {
|
|
93
|
+
...base, ok: false, content: null, problem: 'file-missing',
|
|
94
|
+
detail: `${sanitizeForMessage(path)} is not a regular file`,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
raw = readFileSync(path, 'utf-8');
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
const code = err?.code;
|
|
101
|
+
return {
|
|
102
|
+
...base, ok: false,
|
|
103
|
+
content: null,
|
|
104
|
+
problem: code === 'ENOENT' ? 'file-missing' : 'file-unreadable',
|
|
105
|
+
detail: `${sanitizeForMessage(path)} could not be read (${sanitizeForMessage(code ?? 'unknown')})`,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
// Reuse the roleguide extractor rather than writing a second marker parser.
|
|
109
|
+
// It already refuses repeated, nested and inverted markers, an empty block,
|
|
110
|
+
// an oversize block and control characters, and each of those is a real way
|
|
111
|
+
// to corrupt per-turn context.
|
|
112
|
+
const result = extractMarkerBlock(raw, `${file}`);
|
|
113
|
+
if (!result.ok || !result.content) {
|
|
114
|
+
return {
|
|
115
|
+
...base, ok: false, content: null,
|
|
116
|
+
problem: result.problem ?? 'content-empty',
|
|
117
|
+
detail: result.detail,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return { ...base, ok: true, content: result.content, problem: null, detail: null };
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Read every shipped standard and render the injectable text.
|
|
124
|
+
*
|
|
125
|
+
* A partial result is still injected. One readable standard reaching every turn
|
|
126
|
+
* beats nothing reaching any turn, and the missing one is named in `warnings`.
|
|
127
|
+
*/
|
|
128
|
+
export function resolveStandards(dirOverride) {
|
|
129
|
+
const dir = dirOverride ?? getStandardsDir();
|
|
130
|
+
if (!dir) {
|
|
131
|
+
return {
|
|
132
|
+
dir: null,
|
|
133
|
+
blocks: [],
|
|
134
|
+
rendered: '',
|
|
135
|
+
complete: false,
|
|
136
|
+
warnings: [
|
|
137
|
+
'Writing standard and report format NOT injected: no standards directory was found. ' +
|
|
138
|
+
'This team writes with no per-turn style or report contract. ' +
|
|
139
|
+
'Fix: set MX_STANDARDS_DIR, or run from a checkout containing ' +
|
|
140
|
+
'mx-agent-system/standards/.',
|
|
141
|
+
],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const blocks = INJECTED_STANDARDS.map((s) => readStandardBlock(dir, s.file, s.title));
|
|
145
|
+
const warnings = [];
|
|
146
|
+
for (const block of blocks) {
|
|
147
|
+
if (block.ok)
|
|
148
|
+
continue;
|
|
149
|
+
warnings.push(`Standard "${sanitizeForMessage(block.file)}" NOT injected (${block.problem}): ` +
|
|
150
|
+
`${sanitizeForMessage(block.detail ?? 'no detail')}. This team writes without it on ` +
|
|
151
|
+
`every turn. Fix: restore the ${sanitizeForMessage(block.file)} marker block in ` +
|
|
152
|
+
`${sanitizeForMessage(dir)}.`);
|
|
153
|
+
}
|
|
154
|
+
const usable = blocks.filter((b) => b.ok && b.content);
|
|
155
|
+
const rendered = usable.length === 0 ? '' : renderStandards(usable);
|
|
156
|
+
// The ceiling is separate from the per-file one because what costs the team is
|
|
157
|
+
// the total re-sent on every turn, and two blocks under the file limit can be
|
|
158
|
+
// over it together.
|
|
159
|
+
const bytes = Buffer.byteLength(rendered, 'utf-8');
|
|
160
|
+
if (bytes > MAX_STANDARDS_BLOCK_BYTES) {
|
|
161
|
+
return {
|
|
162
|
+
dir,
|
|
163
|
+
blocks,
|
|
164
|
+
rendered: '',
|
|
165
|
+
complete: false,
|
|
166
|
+
warnings: [
|
|
167
|
+
...warnings,
|
|
168
|
+
`Writing standard and report format NOT injected: the rendered block is ` +
|
|
169
|
+
`${Math.round(bytes / 1024)} KiB, over the ${MAX_STANDARDS_BLOCK_BYTES / 1024} KiB ` +
|
|
170
|
+
`limit. This text is re-sent on EVERY conversation turn, so an oversize block ` +
|
|
171
|
+
`evicts the team's working context. Fix: shorten the marked blocks in ` +
|
|
172
|
+
`${sanitizeForMessage(dir)}.`,
|
|
173
|
+
],
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
dir,
|
|
178
|
+
blocks,
|
|
179
|
+
rendered,
|
|
180
|
+
complete: usable.length === INJECTED_STANDARDS.length,
|
|
181
|
+
warnings,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/** Compose the blocks into the text written into CLAUDE.local.md. */
|
|
185
|
+
export function renderStandards(blocks) {
|
|
186
|
+
const parts = [
|
|
187
|
+
'# Framework standards (every-turn reinforcement)',
|
|
188
|
+
'',
|
|
189
|
+
'> Pinned here so they re-inject on every conversation turn. The full standards, with' +
|
|
190
|
+
' worked before-and-after corrections, are in `mx-agent-system/standards/`.',
|
|
191
|
+
'',
|
|
192
|
+
];
|
|
193
|
+
for (const block of blocks) {
|
|
194
|
+
if (!block.ok || !block.content)
|
|
195
|
+
continue;
|
|
196
|
+
parts.push(`## ${block.title}`, '', block.content, '');
|
|
197
|
+
}
|
|
198
|
+
parts.push('---', '');
|
|
199
|
+
return parts.join('\n');
|
|
200
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EAAE;YACZ,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE;gBACR,GAAG,QAAQ;gBACX,yEAAyE;oBACvE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,yBAAyB,GAAG,IAAI,OAAO;oBACpF,+EAA+E;oBAC/E,uEAAuE;oBACvE,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG;aAChC;SACF,CAAC;IACJ,CAAC;IAED,OAAO;QACL,GAAG;QACH,MAAM;QACN,QAAQ;QACR,QAAQ,EAAE,MAAM,CAAC,MAAM,KAAK,kBAAkB,CAAC,MAAM;QACrD,QAAQ;KACT,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,MAAM,KAAK,GAAG;QACZ,kDAAkD;QAClD,EAAE;QACF,sFAAsF;YACpF,4EAA4E;QAC9E,EAAE;KACH,CAAC;IACF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAAE,SAAS;QAC1C,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACtB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* team-identity -- which team `mx-agent start` resolves to, and whether that is
|
|
3
|
+
* the team the worktree records (#410).
|
|
4
|
+
*
|
|
5
|
+
* WHAT WENT WRONG. `start.ts` derived its team slug as
|
|
6
|
+
* `process.env.CLAUDE_TEAM_NAME || name`, so an inherited environment variable
|
|
7
|
+
* outranked the command's own positional argument. Every other identity in the
|
|
8
|
+
* command comes from that argument — the worktree (`start.ts:646`), the catalog
|
|
9
|
+
* entry and the roleguide (`start.ts:749-756`) — and only the every-turn
|
|
10
|
+
* behavioral block written into `CLAUDE.local.md` came from the variable. A
|
|
11
|
+
* session started for one team could therefore be given another team's block,
|
|
12
|
+
* with no refusal and no diagnostic. `CLAUDE_TEAM_NAME` is exported into every
|
|
13
|
+
* spawned session (`lib/agent-session.ts:286`, `lib/claude.ts:1716`), so a
|
|
14
|
+
* leader running `mx-agent start <other-team>` reproduces it without anyone
|
|
15
|
+
* setting a variable by hand.
|
|
16
|
+
*
|
|
17
|
+
* THE RULE IS HERE AND NOWHERE ELSE. `start.ts` holds no precedence expression
|
|
18
|
+
* of its own; it calls `checkStartTeamIdentity` and uses what comes back. The
|
|
19
|
+
* completion check's row 8 (`commands/create.ts`) calls the same function. One
|
|
20
|
+
* rule, two readers: the row cannot report a precedence the command does not
|
|
21
|
+
* apply, which is what lets the row report the failing value against the pre-fix
|
|
22
|
+
* rule rather than only once the fix is in (#428 criterion 6).
|
|
23
|
+
*
|
|
24
|
+
* IT WARNS; IT DOES NOT REFUSE. Per #4123's tiering — recorded at
|
|
25
|
+
* `lib/claude.ts:860-862` and quoted in #428 — the fail-CLOSED tier is reserved
|
|
26
|
+
* for the hooks / settings.json / agent-config security subclass, and this is
|
|
27
|
+
* not that. Every warning carries a code, so a degraded start is machine-visible
|
|
28
|
+
* in the structured startup report rather than living only in a scrollback.
|
|
29
|
+
* Whether a mismatch should refuse is a product-owner decision, not this
|
|
30
|
+
* module's.
|
|
31
|
+
*
|
|
32
|
+
* NOTHING HERE THROWS AND NOTHING HERE WRITES. Both functions are pure given
|
|
33
|
+
* their inputs plus one read of `.mx-code-context.json`, which
|
|
34
|
+
* `readCodeContextValues` already performs without throwing.
|
|
35
|
+
*/
|
|
36
|
+
/** The environment variable the pre-fix rule let outrank the argument. */
|
|
37
|
+
export declare const TEAM_NAME_ENV = "CLAUDE_TEAM_NAME";
|
|
38
|
+
/** Which input the resolved slug came from. `none` means neither was given. */
|
|
39
|
+
export type TeamSlugSource = 'argument' | 'environment' | 'none';
|
|
40
|
+
export interface StartTeamSlugResolution {
|
|
41
|
+
/** The team whose behavioral block a start would write. Empty when neither input held one. */
|
|
42
|
+
slug: string;
|
|
43
|
+
source: TeamSlugSource;
|
|
44
|
+
/** `CLAUDE_TEAM_NAME` as read, or null when it is unset or empty. */
|
|
45
|
+
envSlug: string | null;
|
|
46
|
+
/** True when the environment named a team and the argument outranked it. */
|
|
47
|
+
envOverridden: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the team slug for a `start`: THE ARGUMENT WINS, and the environment
|
|
51
|
+
* variable is the fallback when no argument is given (#410 remedy 1, #428 part
|
|
52
|
+
* 1).
|
|
53
|
+
*
|
|
54
|
+
* An empty string reads as absent on both sides, which is what the pre-fix `||`
|
|
55
|
+
* expression did and what commander's `<name>` already guarantees for the
|
|
56
|
+
* argument on the command path. Neither value is trimmed or validated here: the
|
|
57
|
+
* slug goes on to `resolveBehavioralInjection`, which refuses an unsafe one and
|
|
58
|
+
* names it (`lib/behavioral-injection.ts:202`), and validating twice in two
|
|
59
|
+
* places is how the two come to disagree.
|
|
60
|
+
*/
|
|
61
|
+
export declare function resolveStartTeamSlug(argSlug: string | undefined, env?: NodeJS.ProcessEnv): StartTeamSlugResolution;
|
|
62
|
+
/**
|
|
63
|
+
* `match` when the resolved slug is the team the worktree records, `mismatch`
|
|
64
|
+
* when the two are known and differ, `unresolvable` when there is nothing to
|
|
65
|
+
* compare against.
|
|
66
|
+
*
|
|
67
|
+
* `unresolvable` is its own outcome and is never collapsed into either of the
|
|
68
|
+
* others, for the reason row 7 states about its own third value: a check that
|
|
69
|
+
* could not look is not a check that passed, and it is not a check that failed.
|
|
70
|
+
*/
|
|
71
|
+
export type StartIdentityVerdict = 'match' | 'mismatch' | 'unresolvable';
|
|
72
|
+
/** The three machine-visible codes a degraded start emits. */
|
|
73
|
+
export type StartIdentityWarningCode =
|
|
74
|
+
/** The environment named one team, the argument named another; the argument won. */
|
|
75
|
+
'start-team-env-ignored'
|
|
76
|
+
/** The resolved team is not the team `.mx-code-context.json` records. */
|
|
77
|
+
| 'start-team-worktree-mismatch'
|
|
78
|
+
/** There was a worktree to read and it recorded no readable team, so nothing was compared. */
|
|
79
|
+
| 'start-team-identity-unreadable';
|
|
80
|
+
export interface StartIdentityWarning {
|
|
81
|
+
message: string;
|
|
82
|
+
code: StartIdentityWarningCode;
|
|
83
|
+
}
|
|
84
|
+
export interface StartTeamIdentity {
|
|
85
|
+
resolution: StartTeamSlugResolution;
|
|
86
|
+
/** `team` from the worktree's `.mx-code-context.json`, or null when absent or unreadable. */
|
|
87
|
+
recorded: string | null;
|
|
88
|
+
verdict: StartIdentityVerdict;
|
|
89
|
+
/** Every warning to emit, in order. The caller logs them; nothing is printed here. */
|
|
90
|
+
warnings: StartIdentityWarning[];
|
|
91
|
+
}
|
|
92
|
+
export interface StartTeamIdentityOptions {
|
|
93
|
+
/** The positional team slug the command was given. */
|
|
94
|
+
argSlug: string | undefined;
|
|
95
|
+
/** The worktree whose `.mx-code-context.json` records the team, or null when there is none to read. */
|
|
96
|
+
worktreePath: string | null;
|
|
97
|
+
/** Defaults to this process's environment, which is the one a launched session inherits. */
|
|
98
|
+
env?: NodeJS.ProcessEnv;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Resolve the team slug and compare it with the worktree's own recorded
|
|
102
|
+
* identity (#410 remedy 2, #428 part 2).
|
|
103
|
+
*
|
|
104
|
+
* THREE WARNINGS, NOT ONE, because the three states have different remedies and
|
|
105
|
+
* any can hold without the others. A start whose environment disagrees with
|
|
106
|
+
* its argument is now correct and still worth saying out loud: the operator
|
|
107
|
+
* asked for one team in a shell that names another, and until #410 that
|
|
108
|
+
* combination silently produced the other team's block. A resolved slug that
|
|
109
|
+
* disagrees with `.mx-code-context.json` is the state #410 observed on
|
|
110
|
+
* `creation-probe`, and it is reachable without any environment variable at all
|
|
111
|
+
* — a worktree provisioned for one team and started under another name.
|
|
112
|
+
*
|
|
113
|
+
* COULD-NOT-LOOK IS THE THIRD, and it has its own code because a check reduced
|
|
114
|
+
* to silence reads exactly like a check that agreed. There was a worktree to
|
|
115
|
+
* read and it recorded no team the reader could use: no file, a file that does
|
|
116
|
+
* not parse, a file holding no `team`, or a symlink, which
|
|
117
|
+
* `readCodeContextValues` declines to follow (`lib/code-context-file.ts:227-228`).
|
|
118
|
+
* All four return the same null, and all four mean the mismatch detector above
|
|
119
|
+
* never ran. Removing or corrupting one file must not buy the same output as a
|
|
120
|
+
* clean start. It warns and does not refuse, at the same tier as the other two.
|
|
121
|
+
*
|
|
122
|
+
* The code is emitted only when there WAS a worktree to read and something was
|
|
123
|
+
* resolved to compare. With no worktree path, and with an empty resolved slug,
|
|
124
|
+
* `unresolvable` is the caller's own doing rather than a degraded worktree, and
|
|
125
|
+
* the caller already knows which input it withheld.
|
|
126
|
+
*
|
|
127
|
+
* VALUES FROM DISK AND FROM THE ENVIRONMENT ARE SANITISED INTO THE MESSAGE.
|
|
128
|
+
* `.mx-code-context.json` is a file this repository writes but does not own at
|
|
129
|
+
* runtime (`lib/code-context-file.ts:175-186`), and `CLAUDE_TEAM_NAME` is
|
|
130
|
+
* whatever the parent shell exported; both reach a terminal through
|
|
131
|
+
* `logWarning`, which is the sink `sanitizeForMessage` exists for.
|
|
132
|
+
*/
|
|
133
|
+
export declare function checkStartTeamIdentity(opts: StartTeamIdentityOptions): StartTeamIdentity;
|
|
134
|
+
//# sourceMappingURL=team-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-identity.d.ts","sourceRoot":"","sources":["../../src/lib/team-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAKH,0EAA0E;AAC1E,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAEhD,+EAA+E;AAC/E,MAAM,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AE,wBAAwB,GAAG,iBAAiB,CA0GxF"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* team-identity -- which team `mx-agent start` resolves to, and whether that is
|
|
3
|
+
* the team the worktree records (#410).
|
|
4
|
+
*
|
|
5
|
+
* WHAT WENT WRONG. `start.ts` derived its team slug as
|
|
6
|
+
* `process.env.CLAUDE_TEAM_NAME || name`, so an inherited environment variable
|
|
7
|
+
* outranked the command's own positional argument. Every other identity in the
|
|
8
|
+
* command comes from that argument — the worktree (`start.ts:646`), the catalog
|
|
9
|
+
* entry and the roleguide (`start.ts:749-756`) — and only the every-turn
|
|
10
|
+
* behavioral block written into `CLAUDE.local.md` came from the variable. A
|
|
11
|
+
* session started for one team could therefore be given another team's block,
|
|
12
|
+
* with no refusal and no diagnostic. `CLAUDE_TEAM_NAME` is exported into every
|
|
13
|
+
* spawned session (`lib/agent-session.ts:286`, `lib/claude.ts:1716`), so a
|
|
14
|
+
* leader running `mx-agent start <other-team>` reproduces it without anyone
|
|
15
|
+
* setting a variable by hand.
|
|
16
|
+
*
|
|
17
|
+
* THE RULE IS HERE AND NOWHERE ELSE. `start.ts` holds no precedence expression
|
|
18
|
+
* of its own; it calls `checkStartTeamIdentity` and uses what comes back. The
|
|
19
|
+
* completion check's row 8 (`commands/create.ts`) calls the same function. One
|
|
20
|
+
* rule, two readers: the row cannot report a precedence the command does not
|
|
21
|
+
* apply, which is what lets the row report the failing value against the pre-fix
|
|
22
|
+
* rule rather than only once the fix is in (#428 criterion 6).
|
|
23
|
+
*
|
|
24
|
+
* IT WARNS; IT DOES NOT REFUSE. Per #4123's tiering — recorded at
|
|
25
|
+
* `lib/claude.ts:860-862` and quoted in #428 — the fail-CLOSED tier is reserved
|
|
26
|
+
* for the hooks / settings.json / agent-config security subclass, and this is
|
|
27
|
+
* not that. Every warning carries a code, so a degraded start is machine-visible
|
|
28
|
+
* in the structured startup report rather than living only in a scrollback.
|
|
29
|
+
* Whether a mismatch should refuse is a product-owner decision, not this
|
|
30
|
+
* module's.
|
|
31
|
+
*
|
|
32
|
+
* NOTHING HERE THROWS AND NOTHING HERE WRITES. Both functions are pure given
|
|
33
|
+
* their inputs plus one read of `.mx-code-context.json`, which
|
|
34
|
+
* `readCodeContextValues` already performs without throwing.
|
|
35
|
+
*/
|
|
36
|
+
import { readCodeContextValues, CODE_CONTEXT_FILENAME } from './code-context-file.js';
|
|
37
|
+
import { sanitizeForMessage } from './behavioral-injection.js';
|
|
38
|
+
/** The environment variable the pre-fix rule let outrank the argument. */
|
|
39
|
+
export const TEAM_NAME_ENV = 'CLAUDE_TEAM_NAME';
|
|
40
|
+
/**
|
|
41
|
+
* Resolve the team slug for a `start`: THE ARGUMENT WINS, and the environment
|
|
42
|
+
* variable is the fallback when no argument is given (#410 remedy 1, #428 part
|
|
43
|
+
* 1).
|
|
44
|
+
*
|
|
45
|
+
* An empty string reads as absent on both sides, which is what the pre-fix `||`
|
|
46
|
+
* expression did and what commander's `<name>` already guarantees for the
|
|
47
|
+
* argument on the command path. Neither value is trimmed or validated here: the
|
|
48
|
+
* slug goes on to `resolveBehavioralInjection`, which refuses an unsafe one and
|
|
49
|
+
* names it (`lib/behavioral-injection.ts:202`), and validating twice in two
|
|
50
|
+
* places is how the two come to disagree.
|
|
51
|
+
*/
|
|
52
|
+
export function resolveStartTeamSlug(argSlug, env = process.env) {
|
|
53
|
+
const envSlug = env[TEAM_NAME_ENV] || null;
|
|
54
|
+
const arg = argSlug || '';
|
|
55
|
+
if (arg) {
|
|
56
|
+
return { slug: arg, source: 'argument', envSlug, envOverridden: envSlug !== null && envSlug !== arg };
|
|
57
|
+
}
|
|
58
|
+
if (envSlug) {
|
|
59
|
+
return { slug: envSlug, source: 'environment', envSlug, envOverridden: false };
|
|
60
|
+
}
|
|
61
|
+
return { slug: '', source: 'none', envSlug: null, envOverridden: false };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolve the team slug and compare it with the worktree's own recorded
|
|
65
|
+
* identity (#410 remedy 2, #428 part 2).
|
|
66
|
+
*
|
|
67
|
+
* THREE WARNINGS, NOT ONE, because the three states have different remedies and
|
|
68
|
+
* any can hold without the others. A start whose environment disagrees with
|
|
69
|
+
* its argument is now correct and still worth saying out loud: the operator
|
|
70
|
+
* asked for one team in a shell that names another, and until #410 that
|
|
71
|
+
* combination silently produced the other team's block. A resolved slug that
|
|
72
|
+
* disagrees with `.mx-code-context.json` is the state #410 observed on
|
|
73
|
+
* `creation-probe`, and it is reachable without any environment variable at all
|
|
74
|
+
* — a worktree provisioned for one team and started under another name.
|
|
75
|
+
*
|
|
76
|
+
* COULD-NOT-LOOK IS THE THIRD, and it has its own code because a check reduced
|
|
77
|
+
* to silence reads exactly like a check that agreed. There was a worktree to
|
|
78
|
+
* read and it recorded no team the reader could use: no file, a file that does
|
|
79
|
+
* not parse, a file holding no `team`, or a symlink, which
|
|
80
|
+
* `readCodeContextValues` declines to follow (`lib/code-context-file.ts:227-228`).
|
|
81
|
+
* All four return the same null, and all four mean the mismatch detector above
|
|
82
|
+
* never ran. Removing or corrupting one file must not buy the same output as a
|
|
83
|
+
* clean start. It warns and does not refuse, at the same tier as the other two.
|
|
84
|
+
*
|
|
85
|
+
* The code is emitted only when there WAS a worktree to read and something was
|
|
86
|
+
* resolved to compare. With no worktree path, and with an empty resolved slug,
|
|
87
|
+
* `unresolvable` is the caller's own doing rather than a degraded worktree, and
|
|
88
|
+
* the caller already knows which input it withheld.
|
|
89
|
+
*
|
|
90
|
+
* VALUES FROM DISK AND FROM THE ENVIRONMENT ARE SANITISED INTO THE MESSAGE.
|
|
91
|
+
* `.mx-code-context.json` is a file this repository writes but does not own at
|
|
92
|
+
* runtime (`lib/code-context-file.ts:175-186`), and `CLAUDE_TEAM_NAME` is
|
|
93
|
+
* whatever the parent shell exported; both reach a terminal through
|
|
94
|
+
* `logWarning`, which is the sink `sanitizeForMessage` exists for.
|
|
95
|
+
*/
|
|
96
|
+
export function checkStartTeamIdentity(opts) {
|
|
97
|
+
const resolution = resolveStartTeamSlug(opts.argSlug, opts.env ?? process.env);
|
|
98
|
+
const recorded = opts.worktreePath
|
|
99
|
+
? readCodeContextValues(opts.worktreePath)?.team ?? null
|
|
100
|
+
: null;
|
|
101
|
+
const verdict = recorded === null || resolution.slug === ''
|
|
102
|
+
? 'unresolvable'
|
|
103
|
+
: recorded === resolution.slug
|
|
104
|
+
? 'match'
|
|
105
|
+
: 'mismatch';
|
|
106
|
+
const warnings = [];
|
|
107
|
+
if (resolution.envOverridden) {
|
|
108
|
+
warnings.push({
|
|
109
|
+
code: 'start-team-env-ignored',
|
|
110
|
+
message: `${TEAM_NAME_ENV} names team "${sanitizeForMessage(resolution.envSlug ?? '', 80)}" and this ` +
|
|
111
|
+
`command was given "${sanitizeForMessage(resolution.slug, 80)}". The argument wins (#410): the ` +
|
|
112
|
+
`every-turn behavioral block written into CLAUDE.local.md is ` +
|
|
113
|
+
`"${sanitizeForMessage(resolution.slug, 80)}"'s. If you meant the other team, run ` +
|
|
114
|
+
`mx-agent start ${sanitizeForMessage(resolution.envSlug ?? '', 80)} in its own worktree; ` +
|
|
115
|
+
`otherwise unset ${TEAM_NAME_ENV}.`,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (verdict === 'mismatch') {
|
|
119
|
+
warnings.push({
|
|
120
|
+
code: 'start-team-worktree-mismatch',
|
|
121
|
+
message: `Team MISMATCH: this start resolved to "${sanitizeForMessage(resolution.slug, 80)}" ` +
|
|
122
|
+
`(from the ${resolution.source}), but ${CODE_CONTEXT_FILENAME} in this worktree records ` +
|
|
123
|
+
`"${sanitizeForMessage(recorded ?? '', 80)}". The every-turn behavioral block, the memory ` +
|
|
124
|
+
`scope and the coordination identity would name different teams. Fix: run mx-agent start ` +
|
|
125
|
+
`${sanitizeForMessage(recorded ?? '', 80)} in this worktree, or start ` +
|
|
126
|
+
`"${sanitizeForMessage(resolution.slug, 80)}" in its own. Session continues.`,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
// THE REMEDIATION IS A COMMAND THAT RUNS, and it was measured rather than
|
|
130
|
+
// read off the argument parser (security re-review, Should Fix 1 on #429).
|
|
131
|
+
// `mx-agent create <slug>` does not run: `--roleguide` is a `requiredOption`
|
|
132
|
+
// (`src/index.ts:185`) and commander exits 1 during parse, before any action.
|
|
133
|
+
// Measured 2026-09-05: `node dist/index.js create platform` exits 1 with
|
|
134
|
+
// `error: required option '--roleguide <path>' not specified`, and `create`
|
|
135
|
+
// is a deprecated alias of `provision` besides (`src/index.ts:184`).
|
|
136
|
+
//
|
|
137
|
+
// `mx-agent provision --roleguide <path> --name <slug>` is the one that
|
|
138
|
+
// repairs this state. A worktree that already exists is RESUMED
|
|
139
|
+
// (`commands/create.ts:5218-5219`) and step 6a rewrites the file
|
|
140
|
+
// (`commands/create.ts:5307`). Measured 2026-09-05 against a sandbox project
|
|
141
|
+
// outside this repository, twice: with the worktree holding neither file
|
|
142
|
+
// (`Identity: neither .mx-code-context.json nor CLAUDE.local.md exists yet`)
|
|
143
|
+
// and with `CLAUDE.local.md` present and the scope file removed, which is the
|
|
144
|
+
// state real team worktrees are in. Both wrote the file and both then
|
|
145
|
+
// reported row 8 asserted. It works from inside the worktree too: the run
|
|
146
|
+
// resolves the main checkout as its root. `--recheck` is NOT the repair. It
|
|
147
|
+
// writes nothing (`src/index.ts:135`), and the file stayed absent when run.
|
|
148
|
+
//
|
|
149
|
+
// THE MESSAGE STATES THE SCOPE OF THAT COMMAND, because a resume does far
|
|
150
|
+
// more than rewrite one file and an operator clearing this warning has not
|
|
151
|
+
// asked for the rest (security re-review, Should Fix 1 on #429). The
|
|
152
|
+
// `if (resuming)` block closes at `commands/create.ts:5231`; the only later
|
|
153
|
+
// `resuming` branches are step 7's memory-attribution rows (`:5628`) and
|
|
154
|
+
// step 8's catalog entry (`:5751`). Everything else runs unconditionally.
|
|
155
|
+
// Read at `42b2f5d`, not carried from the review:
|
|
156
|
+
// step 5 (`:5253`) `syncClaudeConfig` regenerates the WHOLE `.claude/`
|
|
157
|
+
// tree — settings.json, hooks, agents, skills, commands, rules —
|
|
158
|
+
// from `origin/<baseBranch>` via the generator's `--from-git` mode
|
|
159
|
+
// (`lib/claude.ts:1150`, `:1203-1215`), then `deployClaudeMd`
|
|
160
|
+
// rewrites CLAUDE.md (`:5254`).
|
|
161
|
+
// step 6 (`:5264`) `writeClaudeLocal` rewrites CLAUDE.local.md.
|
|
162
|
+
// step 6e (`:5493`) `buildCliInWorktree` runs npm ci and npm run build in
|
|
163
|
+
// the worktree, skipped only when row 13 or the anchors refuse.
|
|
164
|
+
// step 8b (`:5813`, call at `:5832`) requests a coordination credential when
|
|
165
|
+
// `usesCredentialEndpoint(cfg.projectSlug)` and the team is on the
|
|
166
|
+
// roster. `CREDENTIAL_ENDPOINT_PROJECTS` holds `'mx-agent'`
|
|
167
|
+
// (`lib/coordination-token.ts:141`) and this project's slug is
|
|
168
|
+
// `mx-agent` (`mx-agent.config.json:8`), so it fires here. The
|
|
169
|
+
// message says "where the project uses one" because this library
|
|
170
|
+
// also runs for projects that take the Key Vault path instead.
|
|
171
|
+
// TWO ITEMS FROM THE REVIEW ARE NOT IN THE MESSAGE. Step 6d (`:5443`) does
|
|
172
|
+
// NOT edit the roleguide's anchors table: `anchorStage` (`:1753`) only stats,
|
|
173
|
+
// reads and parses, and contains no write call. And a resume neither
|
|
174
|
+
// overwrites a memory that already exists nor rewrites an existing catalog
|
|
175
|
+
// entry (`:5764`, "a resume leaves it byte for byte"), so naming those as
|
|
176
|
+
// effects would overstate what an operator gets.
|
|
177
|
+
if (verdict === 'unresolvable' && opts.worktreePath && resolution.slug !== '') {
|
|
178
|
+
warnings.push({
|
|
179
|
+
code: 'start-team-identity-unreadable',
|
|
180
|
+
message: `Team identity NOT CHECKED: ${CODE_CONTEXT_FILENAME} in this worktree records no readable ` +
|
|
181
|
+
`team, so the resolved team "${sanitizeForMessage(resolution.slug, 80)}" (from the ` +
|
|
182
|
+
`${resolution.source}) was not compared against anything. The file is missing, does not ` +
|
|
183
|
+
`parse, holds no team, or is a symlink, which is not followed. Fix: run mx-agent provision ` +
|
|
184
|
+
`--roleguide <path> --name ${sanitizeForMessage(resolution.slug, 80)}. That RE-PROVISIONS ` +
|
|
185
|
+
`this worktree rather than restoring one file: it also regenerates .claude/ (settings.json ` +
|
|
186
|
+
`and hooks) and CLAUDE.md from origin, rewrites CLAUDE.local.md, rebuilds the CLI here, and ` +
|
|
187
|
+
`requests this team's coordination credential where the project uses one. To repair only ` +
|
|
188
|
+
`this file, restore it by hand. Session continues.`,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
return { resolution, recorded, verdict, warnings };
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=team-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-identity.js","sourceRoot":"","sources":["../../src/lib/team-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,0EAA0E;AAC1E,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAehD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA2B,EAC3B,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC;IAC3C,MAAM,GAAG,GAAG,OAAO,IAAI,EAAE,CAAC;IAE1B,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;IACxG,CAAC;IACD,IAAI,OAAO,EA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