@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,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* report-format.ts — the seven sections every agent report answers, the
|
|
3
|
+
* skeleton the framework writes, and the check that refuses a report missing
|
|
4
|
+
* one.
|
|
5
|
+
*
|
|
6
|
+
* PROBLEM. Across 12 real sessions and 190 moments where an agent needed the
|
|
7
|
+
* operator, 3 reached him. 25 of the 28 moments classed as an explicit question
|
|
8
|
+
* were agents writing that they needed a decision, in prose, into a channel
|
|
9
|
+
* nobody reads (`docs/fleet-behavior-from-transcripts.md` finding 3c). The same
|
|
10
|
+
* repository produced roughly forty commits and nine documents in two days, and
|
|
11
|
+
* the person they were written for asked four times what the work was. The
|
|
12
|
+
* defect is the format rather than the effort, so the format is the fix.
|
|
13
|
+
*
|
|
14
|
+
* Two sections do most of the work. Section 3 states the command behind each
|
|
15
|
+
* claim, which is what makes a finding challengeable; this repository published
|
|
16
|
+
* eight figures in one week that were correct against the wrong thing, and the
|
|
17
|
+
* source line is what made them findable (`.mx-agent/lessons.md` L2). Section 5
|
|
18
|
+
* states what would overturn the finding, which is what makes a wrong finding
|
|
19
|
+
* cheap to check.
|
|
20
|
+
*
|
|
21
|
+
* FAILURE MODEL — loud and FAIL-CLOSED at the check. `checkReport` is pure and
|
|
22
|
+
* never throws; it returns every problem it found. `mx-agent report check`
|
|
23
|
+
* refuses on any problem, the same shape as the provisioning behavioral-block
|
|
24
|
+
* contract in `commands/create.ts`: a throw rather than a `process.exit`, so a
|
|
25
|
+
* caller that wraps it keeps its recovery path. Refusing at the moment a person
|
|
26
|
+
* is looking is what stops the state being created, and warning is what let the
|
|
27
|
+
* roleguide gap run for four weeks (#4541).
|
|
28
|
+
*
|
|
29
|
+
* ONE SOURCE FOR THE SEVEN. `REPORT_SECTIONS` below is the only list. The
|
|
30
|
+
* skeleton is generated from it and `mx-agent-system/standards/report-format.md`
|
|
31
|
+
* is checked against it by a test, so the document and the validator cannot
|
|
32
|
+
* drift apart.
|
|
33
|
+
*/
|
|
34
|
+
/** Canonical heading text, plus everything needed to match and to generate. */
|
|
35
|
+
export interface ReportSection {
|
|
36
|
+
/** 1 through 7, and the order they must appear in. */
|
|
37
|
+
index: number;
|
|
38
|
+
/** Heading text the skeleton writes. */
|
|
39
|
+
heading: string;
|
|
40
|
+
/** Normalised forms this heading is accepted under. */
|
|
41
|
+
aliases: string[];
|
|
42
|
+
/** One line under the heading in the skeleton, written as an HTML comment. */
|
|
43
|
+
prompt: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const REPORT_SECTIONS: readonly ReportSection[];
|
|
46
|
+
export type ReportProblemCode = 'section-missing' | 'section-empty' | 'section-repeated' | 'sections-out-of-order' | 'goal-rung-missing' | 'evidence-missing';
|
|
47
|
+
export interface ReportProblem {
|
|
48
|
+
code: ReportProblemCode;
|
|
49
|
+
/** Section number the problem belongs to, or null for a whole-report problem. */
|
|
50
|
+
section: number | null;
|
|
51
|
+
/** One line naming the problem and the fix. */
|
|
52
|
+
detail: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ReportCheckResult {
|
|
55
|
+
ok: boolean;
|
|
56
|
+
problems: ReportProblem[];
|
|
57
|
+
/** Section body text, keyed by section index. Present only for headings found. */
|
|
58
|
+
bodies: Map<number, string>;
|
|
59
|
+
/** Section indexes in the order the document states them. */
|
|
60
|
+
order: number[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Match a heading tolerantly.
|
|
64
|
+
*
|
|
65
|
+
* Any heading level, an optional leading number, optional bold, and any
|
|
66
|
+
* trailing punctuation. Apostrophes are dropped so "What I'm not sure about"
|
|
67
|
+
* matches "what im not sure about". A report is refused for missing a section,
|
|
68
|
+
* never for how it punctuated one.
|
|
69
|
+
*/
|
|
70
|
+
export declare function normaliseHeading(line: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Strip what the writer did not write.
|
|
73
|
+
*
|
|
74
|
+
* The skeleton's prompts are HTML comments, so an unfilled skeleton has no body
|
|
75
|
+
* text at all and fails `section-empty`. That is deliberate: `report new` piped
|
|
76
|
+
* straight into `report check` must be refused, or the skeleton becomes a way
|
|
77
|
+
* to pass the check without answering anything.
|
|
78
|
+
*/
|
|
79
|
+
export declare function stripNonContent(body: string): string;
|
|
80
|
+
/**
|
|
81
|
+
* Does section 3 state a source a reader could re-run?
|
|
82
|
+
*
|
|
83
|
+
* Deliberately shallow. It cannot tell whether the command is the one that
|
|
84
|
+
* produced the number, which is exactly the failure L2 records, and only
|
|
85
|
+
* re-running catches that. What it can do is refuse a section of bare
|
|
86
|
+
* assertions, which is the common case.
|
|
87
|
+
*/
|
|
88
|
+
export declare function statesEvidence(body: string): boolean;
|
|
89
|
+
/** Does section 1 name a rung of the goal ladder? */
|
|
90
|
+
export declare function namesGoalRung(body: string): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Check a report. Pure, never throws, returns every problem it found.
|
|
93
|
+
*
|
|
94
|
+
* Reporting all problems at once matters more than it sounds. A check that
|
|
95
|
+
* stops at the first missing section turns one fix into seven round trips, and
|
|
96
|
+
* an agent that has been refused seven times stops using the format.
|
|
97
|
+
*/
|
|
98
|
+
export declare function checkReport(text: string): ReportCheckResult;
|
|
99
|
+
export interface SkeletonOptions {
|
|
100
|
+
/** One line for section 1, written above the prompt. */
|
|
101
|
+
task?: string;
|
|
102
|
+
/** Goal rung, 1 to 3. Written into section 1 so the check has something to read. */
|
|
103
|
+
rung?: 1 | 2 | 3;
|
|
104
|
+
/** Title line. Defaults to no title. */
|
|
105
|
+
title?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Write the seven headings.
|
|
109
|
+
*
|
|
110
|
+
* Prompts are HTML comments so they render as nothing and strip to nothing.
|
|
111
|
+
* A skeleton with no answers therefore fails `report check`, which is the
|
|
112
|
+
* property that keeps the skeleton from becoming a way past it.
|
|
113
|
+
*/
|
|
114
|
+
export declare function renderReportSkeleton(options?: SkeletonOptions): string;
|
|
115
|
+
/**
|
|
116
|
+
* Refusal from the report-format contract.
|
|
117
|
+
*
|
|
118
|
+
* A THROW, not a `process.exit`, for the reason `BehavioralContractError`
|
|
119
|
+
* records: a caller that wraps this keeps its own recovery path, and the
|
|
120
|
+
* top-level action already catches, prints and exits 1.
|
|
121
|
+
*/
|
|
122
|
+
export declare class ReportFormatError extends Error {
|
|
123
|
+
readonly code = "report-format-refused";
|
|
124
|
+
readonly problems: ReportProblem[];
|
|
125
|
+
constructor(message: string, problems: ReportProblem[]);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The refusal an operator reads. Plain text, no colour, so it is testable and
|
|
129
|
+
* so it survives being piped into a file or a pull request comment.
|
|
130
|
+
*/
|
|
131
|
+
export declare function refusalMessage(result: ReportCheckResult, label: string): string;
|
|
132
|
+
//# sourceMappingURL=report-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-format.d.ts","sourceRoot":"","sources":["../../src/lib/report-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAiD1C,CAAC;AAEX,MAAM,MAAM,iBAAiB,GACzB,iBAAiB,GACjB,eAAe,GACf,kBAAkB,GAClB,uBAAuB,GACvB,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,iFAAiF;IACjF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IAC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the seven sections every agent report answers, the
|
|
3
|
+
* skeleton the framework writes, and the check that refuses a report missing
|
|
4
|
+
* one.
|
|
5
|
+
*
|
|
6
|
+
* PROBLEM. Across 12 real sessions and 190 moments where an agent needed the
|
|
7
|
+
* operator, 3 reached him. 25 of the 28 moments classed as an explicit question
|
|
8
|
+
* were agents writing that they needed a decision, in prose, into a channel
|
|
9
|
+
* nobody reads (`docs/fleet-behavior-from-transcripts.md` finding 3c). The same
|
|
10
|
+
* repository produced roughly forty commits and nine documents in two days, and
|
|
11
|
+
* the person they were written for asked four times what the work was. The
|
|
12
|
+
* defect is the format rather than the effort, so the format is the fix.
|
|
13
|
+
*
|
|
14
|
+
* Two sections do most of the work. Section 3 states the command behind each
|
|
15
|
+
* claim, which is what makes a finding challengeable; this repository published
|
|
16
|
+
* eight figures in one week that were correct against the wrong thing, and the
|
|
17
|
+
* source line is what made them findable (`.mx-agent/lessons.md` L2). Section 5
|
|
18
|
+
* states what would overturn the finding, which is what makes a wrong finding
|
|
19
|
+
* cheap to check.
|
|
20
|
+
*
|
|
21
|
+
* FAILURE MODEL — loud and FAIL-CLOSED at the check. `checkReport` is pure and
|
|
22
|
+
* never throws; it returns every problem it found. `mx-agent report check`
|
|
23
|
+
* refuses on any problem, the same shape as the provisioning behavioral-block
|
|
24
|
+
* contract in `commands/create.ts`: a throw rather than a `process.exit`, so a
|
|
25
|
+
* caller that wraps it keeps its recovery path. Refusing at the moment a person
|
|
26
|
+
* is looking is what stops the state being created, and warning is what let the
|
|
27
|
+
* roleguide gap run for four weeks (#4541).
|
|
28
|
+
*
|
|
29
|
+
* ONE SOURCE FOR THE SEVEN. `REPORT_SECTIONS` below is the only list. The
|
|
30
|
+
* skeleton is generated from it and `mx-agent-system/standards/report-format.md`
|
|
31
|
+
* is checked against it by a test, so the document and the validator cannot
|
|
32
|
+
* drift apart.
|
|
33
|
+
*/
|
|
34
|
+
export const REPORT_SECTIONS = [
|
|
35
|
+
{
|
|
36
|
+
index: 1,
|
|
37
|
+
heading: 'What I was asked',
|
|
38
|
+
aliases: ['what i was asked', 'what i was asked to do'],
|
|
39
|
+
prompt: 'One sentence. Then name the rung: Level 1, Level 2 or Level 3 from .mx-agent/goals.md.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
index: 2,
|
|
43
|
+
heading: 'What I did',
|
|
44
|
+
aliases: ['what i did'],
|
|
45
|
+
prompt: 'The actions, not the reasoning. What you ran, read, wrote and changed.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
index: 3,
|
|
49
|
+
heading: 'What I found',
|
|
50
|
+
aliases: ['what i found'],
|
|
51
|
+
prompt: 'Each claim with the command, the file:line, or the query that produced it. ' +
|
|
52
|
+
'A claim with no source belongs in section 4.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
index: 4,
|
|
56
|
+
heading: 'What I am not sure about',
|
|
57
|
+
aliases: ['what i am not sure about', 'what im not sure about'],
|
|
58
|
+
prompt: 'State it rather than omitting it. Anything you could not run belongs here by name.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
index: 5,
|
|
62
|
+
heading: 'What would change my mind',
|
|
63
|
+
aliases: ['what would change my mind'],
|
|
64
|
+
prompt: 'The specific observation that would overturn each finding. Not "more data": ' +
|
|
65
|
+
'name the file, the run or the number.',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
index: 6,
|
|
69
|
+
heading: 'What I need from you',
|
|
70
|
+
aliases: ['what i need from you'],
|
|
71
|
+
prompt: 'A decision, or the word Nothing. This section is the channel, not your prose.',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
index: 7,
|
|
75
|
+
heading: 'What I would do next',
|
|
76
|
+
aliases: ['what i would do next'],
|
|
77
|
+
prompt: 'What you would pick up, and why that rather than something else.',
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* Match a heading tolerantly.
|
|
82
|
+
*
|
|
83
|
+
* Any heading level, an optional leading number, optional bold, and any
|
|
84
|
+
* trailing punctuation. Apostrophes are dropped so "What I'm not sure about"
|
|
85
|
+
* matches "what im not sure about". A report is refused for missing a section,
|
|
86
|
+
* never for how it punctuated one.
|
|
87
|
+
*/
|
|
88
|
+
export function normaliseHeading(line) {
|
|
89
|
+
return line
|
|
90
|
+
.replace(/^\s*#{1,6}\s*/, '')
|
|
91
|
+
.replace(/\*\*/g, '')
|
|
92
|
+
.replace(/^\s*\d+\s*[.)::-]\s*/, '')
|
|
93
|
+
.replace(/['‘’]/g, '')
|
|
94
|
+
.replace(/[.:;!?,\s]+$/, '')
|
|
95
|
+
.replace(/\s+/g, ' ')
|
|
96
|
+
.trim()
|
|
97
|
+
.toLowerCase();
|
|
98
|
+
}
|
|
99
|
+
function sectionForHeading(line) {
|
|
100
|
+
const key = normaliseHeading(line);
|
|
101
|
+
if (key === '')
|
|
102
|
+
return null;
|
|
103
|
+
return REPORT_SECTIONS.find((s) => s.aliases.includes(key)) ?? null;
|
|
104
|
+
}
|
|
105
|
+
/** True for a markdown ATX heading line, outside a fenced block. */
|
|
106
|
+
function isHeadingLine(line) {
|
|
107
|
+
return /^\s*#{1,6}\s+\S/.test(line);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Strip what the writer did not write.
|
|
111
|
+
*
|
|
112
|
+
* The skeleton's prompts are HTML comments, so an unfilled skeleton has no body
|
|
113
|
+
* text at all and fails `section-empty`. That is deliberate: `report new` piped
|
|
114
|
+
* straight into `report check` must be refused, or the skeleton becomes a way
|
|
115
|
+
* to pass the check without answering anything.
|
|
116
|
+
*/
|
|
117
|
+
export function stripNonContent(body) {
|
|
118
|
+
return body
|
|
119
|
+
.replace(/<!--[\s\S]*?-->/g, ' ')
|
|
120
|
+
.replace(/^\s*[-*+]\s*$/gm, ' ')
|
|
121
|
+
.trim();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Does section 3 state a source a reader could re-run?
|
|
125
|
+
*
|
|
126
|
+
* Deliberately shallow. It cannot tell whether the command is the one that
|
|
127
|
+
* produced the number, which is exactly the failure L2 records, and only
|
|
128
|
+
* re-running catches that. What it can do is refuse a section of bare
|
|
129
|
+
* assertions, which is the common case.
|
|
130
|
+
*/
|
|
131
|
+
export function statesEvidence(body) {
|
|
132
|
+
if (/```/.test(body))
|
|
133
|
+
return true;
|
|
134
|
+
if (/`[^`\n]{3,}`/.test(body))
|
|
135
|
+
return true;
|
|
136
|
+
if (/\b[\w./-]+\.[a-z]{1,5}:\d+\b/i.test(body))
|
|
137
|
+
return true;
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
/** Does section 1 name a rung of the goal ladder? */
|
|
141
|
+
export function namesGoalRung(body) {
|
|
142
|
+
return /\blevel\s*[123]\b/i.test(body);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Check a report. Pure, never throws, returns every problem it found.
|
|
146
|
+
*
|
|
147
|
+
* Reporting all problems at once matters more than it sounds. A check that
|
|
148
|
+
* stops at the first missing section turns one fix into seven round trips, and
|
|
149
|
+
* an agent that has been refused seven times stops using the format.
|
|
150
|
+
*/
|
|
151
|
+
export function checkReport(text) {
|
|
152
|
+
const lines = text.split('\n');
|
|
153
|
+
const bodies = new Map();
|
|
154
|
+
const order = [];
|
|
155
|
+
const problems = [];
|
|
156
|
+
const seen = new Map();
|
|
157
|
+
let fenced = false;
|
|
158
|
+
let current = null;
|
|
159
|
+
let buffer = [];
|
|
160
|
+
const flush = () => {
|
|
161
|
+
if (!current)
|
|
162
|
+
return;
|
|
163
|
+
const body = stripNonContent(buffer.join('\n'));
|
|
164
|
+
// A repeated heading keeps the first body rather than the last. Which of two
|
|
165
|
+
// bodies is "the" section is not a question this parser is entitled to
|
|
166
|
+
// guess, and the repetition is reported either way.
|
|
167
|
+
if (!bodies.has(current.index))
|
|
168
|
+
bodies.set(current.index, body);
|
|
169
|
+
buffer = [];
|
|
170
|
+
};
|
|
171
|
+
for (const line of lines) {
|
|
172
|
+
if (/^\s*```/.test(line)) {
|
|
173
|
+
fenced = !fenced;
|
|
174
|
+
if (current)
|
|
175
|
+
buffer.push(line);
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (!fenced && isHeadingLine(line)) {
|
|
179
|
+
const section = sectionForHeading(line);
|
|
180
|
+
if (section) {
|
|
181
|
+
flush();
|
|
182
|
+
current = section;
|
|
183
|
+
order.push(section.index);
|
|
184
|
+
seen.set(section.index, (seen.get(section.index) ?? 0) + 1);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
// A heading that is not one of the seven ends the previous section's body
|
|
188
|
+
// and starts no new one, so text under an unrelated heading is never
|
|
189
|
+
// counted as answering a required section.
|
|
190
|
+
flush();
|
|
191
|
+
current = null;
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (current)
|
|
195
|
+
buffer.push(line);
|
|
196
|
+
}
|
|
197
|
+
flush();
|
|
198
|
+
for (const section of REPORT_SECTIONS) {
|
|
199
|
+
const count = seen.get(section.index) ?? 0;
|
|
200
|
+
if (count === 0) {
|
|
201
|
+
problems.push({
|
|
202
|
+
code: 'section-missing',
|
|
203
|
+
section: section.index,
|
|
204
|
+
detail: `Section ${section.index} "${section.heading}" is absent.`,
|
|
205
|
+
});
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (count > 1) {
|
|
209
|
+
problems.push({
|
|
210
|
+
code: 'section-repeated',
|
|
211
|
+
section: section.index,
|
|
212
|
+
detail: `Section ${section.index} "${section.heading}" appears ${count} times. ` +
|
|
213
|
+
`Exactly one of each is required.`,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
const body = bodies.get(section.index) ?? '';
|
|
217
|
+
if (body === '') {
|
|
218
|
+
problems.push({
|
|
219
|
+
code: 'section-empty',
|
|
220
|
+
section: section.index,
|
|
221
|
+
detail: `Section ${section.index} "${section.heading}" has a heading and no content. ` +
|
|
222
|
+
`An empty section is the same failure as a missing one.`,
|
|
223
|
+
});
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (section.index === 1 && !namesGoalRung(body)) {
|
|
227
|
+
problems.push({
|
|
228
|
+
code: 'goal-rung-missing',
|
|
229
|
+
section: 1,
|
|
230
|
+
detail: 'Section 1 names no rung. State Level 1, Level 2 or Level 3 from ' +
|
|
231
|
+
'.mx-agent/goals.md. An agent that cannot name its rung has an assignment ' +
|
|
232
|
+
'nobody can evaluate.',
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (section.index === 3 && !statesEvidence(body)) {
|
|
236
|
+
problems.push({
|
|
237
|
+
code: 'evidence-missing',
|
|
238
|
+
section: 3,
|
|
239
|
+
detail: 'Section 3 states no source. Every claim needs the command, the file:line, or ' +
|
|
240
|
+
'the query that produced it, so a reader can re-run it instead of believing it.',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const found = order.filter((index, i) => order.indexOf(index) === i);
|
|
245
|
+
const ascending = found.every((index, i) => i === 0 || index > found[i - 1]);
|
|
246
|
+
if (found.length > 1 && !ascending) {
|
|
247
|
+
problems.push({
|
|
248
|
+
code: 'sections-out-of-order',
|
|
249
|
+
section: null,
|
|
250
|
+
detail: `Sections appear as ${found.join(', ')}. The order is fixed at 1 to 7, because a ` +
|
|
251
|
+
`reader looks for section 5 in the same place in every report.`,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
return { ok: problems.length === 0, problems, bodies, order };
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Write the seven headings.
|
|
258
|
+
*
|
|
259
|
+
* Prompts are HTML comments so they render as nothing and strip to nothing.
|
|
260
|
+
* A skeleton with no answers therefore fails `report check`, which is the
|
|
261
|
+
* property that keeps the skeleton from becoming a way past it.
|
|
262
|
+
*/
|
|
263
|
+
export function renderReportSkeleton(options = {}) {
|
|
264
|
+
const out = [];
|
|
265
|
+
if (options.title)
|
|
266
|
+
out.push(`# ${options.title}`, '');
|
|
267
|
+
for (const section of REPORT_SECTIONS) {
|
|
268
|
+
out.push(`## ${section.index}. ${section.heading}`);
|
|
269
|
+
out.push('');
|
|
270
|
+
out.push(`<!-- ${section.prompt} -->`);
|
|
271
|
+
if (section.index === 1) {
|
|
272
|
+
if (options.task)
|
|
273
|
+
out.push('', options.task);
|
|
274
|
+
if (options.rung)
|
|
275
|
+
out.push('', `Serves Level ${options.rung}.`);
|
|
276
|
+
}
|
|
277
|
+
out.push('');
|
|
278
|
+
}
|
|
279
|
+
return out.join('\n').replace(/\n{3,}/g, '\n\n').trimEnd() + '\n';
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Refusal from the report-format contract.
|
|
283
|
+
*
|
|
284
|
+
* A THROW, not a `process.exit`, for the reason `BehavioralContractError`
|
|
285
|
+
* records: a caller that wraps this keeps its own recovery path, and the
|
|
286
|
+
* top-level action already catches, prints and exits 1.
|
|
287
|
+
*/
|
|
288
|
+
export class ReportFormatError extends Error {
|
|
289
|
+
code = 'report-format-refused';
|
|
290
|
+
problems;
|
|
291
|
+
constructor(message, problems) {
|
|
292
|
+
super(message);
|
|
293
|
+
this.name = 'ReportFormatError';
|
|
294
|
+
this.problems = problems;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* The refusal an operator reads. Plain text, no colour, so it is testable and
|
|
299
|
+
* so it survives being piped into a file or a pull request comment.
|
|
300
|
+
*/
|
|
301
|
+
export function refusalMessage(result, label) {
|
|
302
|
+
const missing = result.problems.filter((p) => p.code === 'section-missing').length;
|
|
303
|
+
const headline = missing > 0
|
|
304
|
+
? `Report REFUSED — ${missing} of ${REPORT_SECTIONS.length} sections are absent.`
|
|
305
|
+
: 'Report REFUSED — the format contract is not met.';
|
|
306
|
+
const lines = ['', headline, '', ` File: ${label}`, ` Problems: ${result.problems.length}`, ''];
|
|
307
|
+
for (const problem of result.problems) {
|
|
308
|
+
lines.push(` [${problem.code}] ${problem.detail}`);
|
|
309
|
+
}
|
|
310
|
+
lines.push('', ' Every agent report answers the same seven things in the same order, so a reader', ' finds section 5 in the same place every time. Section 3 makes a finding', ' challengeable. Section 5 makes a wrong finding cheap to overturn.', '', ' The seven:');
|
|
311
|
+
for (const section of REPORT_SECTIONS) {
|
|
312
|
+
lines.push(` ${section.index}. ${section.heading}`);
|
|
313
|
+
}
|
|
314
|
+
lines.push('', ` Fix: mx-agent report new > ${label} then answer each section.`, ' Standard: mx-agent-system/standards/report-format.md', '');
|
|
315
|
+
return lines.join('\n');
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=report-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-format.js","sourceRoot":"","sources":["../../src/lib/report-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAcH,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD;QACE,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;QACvD,MAAM,EACJ,wFAAwF;KAC3F;IACD;QACE,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,CAAC,YAAY,CAAC;QACvB,MAAM,EAAE,wEAAwE;KACjF;IACD;QACE,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,CAAC,cAAc,CAAC;QACzB,MAAM,EACJ,6EAA6E;YAC7E,8CAA8C;KACjD;IACD;QACE,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,0BAA0B;QACnC,OAAO,EAAE,CAAC,0BAA0B,EAAE,wBAAwB,CAAC;QAC/D,MAAM,EACJ,oFAAoF;KACvF;IACD;QACE,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,2BAA2B;QACpC,OAAO,EAAE,CAAC,2BAA2B,CAAC;QACtC,MAAM,EACJ,8EAA8E;YAC9E,uCAAuC;KAC1C;IACD;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O,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,mFAAmF,EACnF,2EAA2E,EAC3E,qEAAqE,EACrE,EAAE,EACF,cAAc,CACf,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,eAAe,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,gCAAgC,KAAK,8BAA8B,EACnE,wDAAwD,EACxD,EAAE,CACH,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the coordination roster on a git ref, as three outcomes (#77).
|
|
3
|
+
*
|
|
4
|
+
* The roster decides which team identity may fetch a token from the dev vault
|
|
5
|
+
* (`coordination-token.ts:75,80,234-243`). Two committed artifacts hold it, and
|
|
6
|
+
* a team is registered only when BOTH do:
|
|
7
|
+
*
|
|
8
|
+
* - `coordination-service/src/config/rosters.ts`, the single source, compiled
|
|
9
|
+
* into the service. Editing it and deploying is what makes the service
|
|
10
|
+
* accept the team's messages.
|
|
11
|
+
* - `mx-agent-system/agent-config/coordination-rosters.generated.json`, the
|
|
12
|
+
* offline file the CLI token gate and the session-start hook read from the
|
|
13
|
+
* calling worktree's checkout. Regenerating it is a manual two-command step
|
|
14
|
+
* (`generate-rosters.ts:10-11`).
|
|
15
|
+
*
|
|
16
|
+
* This module READS both on a ref. It writes nothing, edits no roster, mints
|
|
17
|
+
* nothing, and makes no network call: the ref is local, updated by the fetch the
|
|
18
|
+
* caller already ran. Neither read can tell whether the service was redeployed
|
|
19
|
+
* after the roster changed, and the row that prints these answers says so.
|
|
20
|
+
*
|
|
21
|
+
* `unresolvable` is its own answer, not a synonym for `absent`, for the reason
|
|
22
|
+
* `catalogEntryOnOriginMain` states: a failed fetch leaves a remote-tracking ref
|
|
23
|
+
* of unknown age, so an entry merged since would read as missing and the
|
|
24
|
+
* operator would be told to make an edit that is already on the base branch
|
|
25
|
+
* (`mx-agent-system/standards/fail-loud-standard.md`).
|
|
26
|
+
*/
|
|
27
|
+
/** Passed, failed and could-not-run, in the shape `catalogEntryOnRef` returns. */
|
|
28
|
+
export type RosterOutcome = 'present' | 'absent' | 'unresolvable';
|
|
29
|
+
/** The offline roster file, `/`-separated because a git object path always is. */
|
|
30
|
+
export declare const ROSTER_JSON_PATH = "mx-agent-system/agent-config/coordination-rosters.generated.json";
|
|
31
|
+
/** The single-source roster module, compiled into the coordination service. */
|
|
32
|
+
export declare const ROSTER_SOURCE_PATH = "mx-agent-system/coordination-service/src/config/rosters.ts";
|
|
33
|
+
export interface RosterReadOptions {
|
|
34
|
+
/** The project the roster is keyed by, e.g. `mx-agent`. */
|
|
35
|
+
project: string;
|
|
36
|
+
/** The base branch, read at `origin/<base>`. Defaults to `main`. */
|
|
37
|
+
baseBranch?: string;
|
|
38
|
+
/**
|
|
39
|
+
* What `fetchOrigin` returned for this run. NO safe default: omitted, it reads
|
|
40
|
+
* as false and the answer is `unresolvable`, so a caller that forgets it gets
|
|
41
|
+
* a could-not-run it has to look at rather than a `present` read off a ref
|
|
42
|
+
* whose age nothing established.
|
|
43
|
+
*/
|
|
44
|
+
fetchOk?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Whether the generated offline roster file on `origin/<base>` lists the slug
|
|
48
|
+
* under the project.
|
|
49
|
+
*
|
|
50
|
+
* `present` means the CLI token gate in a checkout of that ref would accept the
|
|
51
|
+
* identity. It does NOT mean the service was redeployed, and it does not mean a
|
|
52
|
+
* token exists: those are the deploy and the mint, neither of which this read
|
|
53
|
+
* can see.
|
|
54
|
+
*/
|
|
55
|
+
export declare function rosterEntryOnRef(projectRoot: string, slug: string, opts: RosterReadOptions): RosterOutcome;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the roster SOURCE on `origin/<base>` lists the slug under the project.
|
|
58
|
+
*
|
|
59
|
+
* Answers the state between "nothing was done" and "everything was done": the
|
|
60
|
+
* array in `rosters.ts` was edited and the generated file was not regenerated.
|
|
61
|
+
* The service would accept the team once redeployed while every CLI reading the
|
|
62
|
+
* offline file still refuses it, which is exactly the drift
|
|
63
|
+
* `roster-source.test.ts` exists to catch in CI, after a commit.
|
|
64
|
+
*
|
|
65
|
+
* Comments are removed from the whole file BEFORE any declaration is located,
|
|
66
|
+
* and only then is the export found and its array read. Order matters both ways.
|
|
67
|
+
* A commented-out `export const PROVISIONED_ROSTERS = [` would otherwise shadow
|
|
68
|
+
* the real declaration and answer for it (security review, Should Fix 2). And
|
|
69
|
+
* `rosters.ts:100-107` holds the slug `platform` in prose, including "is still
|
|
70
|
+
* NOT an enqueue target", which a whole-file substring read reports as
|
|
71
|
+
* membership.
|
|
72
|
+
*
|
|
73
|
+
* String contents survive the strip, so a `//` or a `]` inside a quoted slug is
|
|
74
|
+
* read as text rather than as a comment or as the end of the array.
|
|
75
|
+
*
|
|
76
|
+
* The file is parsed as text. Nothing in it is evaluated, imported or executed.
|
|
77
|
+
*/
|
|
78
|
+
export declare function rosterSourceHasSlug(projectRoot: string, slug: string, project: string, opts?: {
|
|
79
|
+
baseBranch?: string;
|
|
80
|
+
fetchOk?: boolean;
|
|
81
|
+
}): RosterOutcome;
|
|
82
|
+
/**
|
|
83
|
+
* The parse, separate from the read so every shape it refuses is testable
|
|
84
|
+
* without a git fixture. Exported for that test.
|
|
85
|
+
*/
|
|
86
|
+
export declare function sourceRosterMembership(source: string, slug: string, project: string): RosterOutcome;
|
|
87
|
+
//# sourceMappingURL=roster.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../../src/lib/roster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AAElE,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,qEAAqE,CAAC;AAEnG,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,+DAA+D,CAAC;AAU/F,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAkCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,iBAAiB,GACtB,aAAa,CAuBf;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GACpD,aAAa,CAOf;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CASnG"}
|