@chankov/agent-fleet 2.1.2 → 2.2.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/.pi/agent-fleet/hooks/coms-stop-hook.mjs +53 -13
- package/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
- package/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
- package/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +4 -0
- package/.pi/agent-fleet/scripts/fleet.ts +13 -17
- package/.pi/agent-fleet/scripts/flow.ts +2 -2
- package/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
- package/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +44 -0
- package/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
- package/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
- package/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
- package/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
- package/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +20 -13
- package/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
- package/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
- package/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
- package/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
- package/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +23 -13
- package/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +100 -14
- package/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +1 -1
- package/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +204 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +9 -3
- package/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +32 -16
- package/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +41 -21
- package/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +21 -0
- package/.pi/agent-fleet/scripts/lib/fleet-command.ts +4 -8
- package/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +2 -1
- package/.pi/agent-fleet/scripts/lib/team-project.ts +0 -2
- package/.pi/agent-fleet/scripts/team-up.ts +5 -12
- package/.pi/agent-fleet/scripts/workflows/lib/git.ts +9 -0
- package/.pi/agent-fleet/scripts/workflows/lib/quality.ts +17 -4
- package/.pi/agents/model-profiles.yaml +0 -2
- package/.pi/harnesses/agent-hub/README.md +116 -67
- package/.pi/harnesses/agent-hub/capability-packs.ts +7 -4
- package/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
- package/.pi/harnesses/agent-hub/commands/context.ts +0 -4
- package/.pi/harnesses/agent-hub/commands/recover.ts +2 -1
- package/.pi/harnesses/agent-hub/config/agents.ts +3 -1
- package/.pi/harnesses/agent-hub/config/model-profiles.ts +3 -0
- package/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +14 -1
- package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +17 -0
- package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +3 -1
- package/.pi/harnesses/agent-hub/dispatch-native-types.ts +4 -0
- package/.pi/harnesses/agent-hub/dispatch-native.ts +9 -3
- package/.pi/harnesses/agent-hub/drift-watchdog.js +5 -10
- package/.pi/harnesses/agent-hub/execution-trace.ts +1 -1
- package/.pi/harnesses/agent-hub/filesystem-tool.ts +1 -1
- package/.pi/harnesses/agent-hub/footer.ts +2 -3
- package/.pi/harnesses/agent-hub/helpers.ts +4 -5
- package/.pi/harnesses/agent-hub/history-projection.ts +1 -1
- package/.pi/harnesses/agent-hub/index.ts +213 -196
- package/.pi/harnesses/agent-hub/input/shortcuts.ts +0 -7
- package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +0 -2
- package/.pi/harnesses/agent-hub/no-progress.ts +14 -9
- package/.pi/harnesses/agent-hub/operator-current-state.ts +5 -1
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/policy/roster.ts +12 -3
- package/.pi/harnesses/agent-hub/policy/work-mode.ts +10 -49
- package/.pi/harnesses/agent-hub/poll-command.ts +12 -4
- package/.pi/harnesses/agent-hub/proactive-snapshot.ts +12 -4
- package/.pi/harnesses/agent-hub/process-obligations.ts +42 -9
- package/.pi/harnesses/agent-hub/prompts/context.ts +17 -0
- package/.pi/harnesses/agent-hub/prompts/fragments.ts +9 -1
- package/.pi/harnesses/agent-hub/prompts/session-start.ts +2 -3
- package/.pi/harnesses/agent-hub/prompts/system-prompt.ts +25 -8
- package/.pi/harnesses/agent-hub/provider-semaphore.js +5 -0
- package/.pi/harnesses/agent-hub/review-continuity.ts +5 -2
- package/.pi/harnesses/agent-hub/review-reuse.ts +2 -1
- package/.pi/harnesses/agent-hub/run-budget.js +22 -2
- package/.pi/harnesses/agent-hub/scope-gate.js +38 -0
- package/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
- package/.pi/harnesses/agent-hub/task-brief.ts +98 -0
- package/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +4 -0
- package/.pi/harnesses/agent-hub/tool-catalog-state.ts +5 -3
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +5 -7
- package/.pi/harnesses/agent-hub/tools/context.ts +2 -0
- package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +2 -1
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +184 -33
- package/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
- package/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
- package/.pi/harnesses/agent-hub/tools/run-flow.ts +41 -10
- package/.pi/harnesses/agent-hub/tools/team-adjust.ts +1 -1
- package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +12 -2
- package/.pi/harnesses/agent-hub/work-mode.ts +44 -49
- package/.pi/harnesses/agent-hub/write-isolation.ts +53 -8
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/codex-compat.ts +97 -0
- package/.pi/harnesses/lib/codex-contract.ts +259 -0
- package/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
- package/.pi/harnesses/lib/coms-core.ts +8 -4
- package/.pi/harnesses/lib/context-budget-child-prompt.ts +1 -1
- package/.pi/harnesses/lib/context-budget-hub-prompt.ts +6 -3
- package/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
- package/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
- package/.pi/harnesses/lib/fleet-codex-chat-view.ts +43 -0
- package/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
- package/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
- package/.pi/harnesses/lib/fleet-connection-control.ts +20 -3
- package/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
- package/.pi/harnesses/lib/fleet-notification-bootstrap.ts +152 -0
- package/.pi/harnesses/lib/fleet-notification-validation.ts +80 -25
- package/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.2.0/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet.ts +244 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/flow.ts +166 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +44 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +204 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/package-lock.json +57 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/package.json +10 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/pi-session.ts +9 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.2.0/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.2.0/.pi/agents/model-profiles.yaml +132 -0
- package/.versions/2.2.0/.pi/agents/peers.yaml +147 -0
- package/.versions/2.2.0/.pi/agents/teams.yaml +41 -0
- package/.versions/2.2.0/.pi/agents/voices.yaml +13 -0
- package/.versions/2.2.0/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.2.0/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.2.0/.pi/extensions/btw/index.ts +916 -0
- package/.versions/2.2.0/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.2.0/.pi/extensions/compact-and-continue/index.ts +136 -0
- package/.versions/2.2.0/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.2.0/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.2.0/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.2.0/.pi/extensions/package.json +9 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/config.ts +199 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/README.md +1633 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/acceptance.ts +204 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/access-approval.ts +266 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/config.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/context.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/recover.ts +62 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/config/agents.ts +183 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/external-blocker.js +92 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/fixtures/registration-surface.json +68 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/footer.ts +29 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/helpers.ts +269 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/index.ts +2722 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/no-progress.ts +627 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/operator-current-state.ts +57 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/work-mode.ts +103 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/poll-command.ts +184 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/presentation.ts +54 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/process-obligations.ts +210 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/return-contract.js +371 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-findings.js +96 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/run-budget.js +362 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/scope-gate.js +271 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/session-audit.ts +331 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/spawn.ts +702 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-brief.ts +98 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/context.ts +149 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +928 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/work-mode.ts +183 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/index.ts +571 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/questions.ts +206 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
- package/.versions/2.2.0/.pi/harnesses/coms/README.md +105 -0
- package/.versions/2.2.0/.pi/harnesses/coms/index.ts +308 -0
- package/.versions/2.2.0/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.2.0/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/README.md +161 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/index.ts +659 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.versions/2.2.0/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
- package/.versions/2.2.0/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.2.0/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/lib/codex-compat.ts +97 -0
- package/.versions/2.2.0/.pi/harnesses/lib/codex-contract.ts +259 -0
- package/.versions/2.2.0/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-core-io.ts +422 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-core.ts +738 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-observation.ts +74 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-response-read.ts +107 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-budget-view.ts +112 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-control-shared.ts +276 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-policy.ts +35 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.versions/2.2.0/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/lib/exact-permission-port.ts +38 -0
- package/.versions/2.2.0/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-chat-view.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/view.ts +338 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-event-source.ts +21 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-bootstrap.ts +152 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.2.0/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.2.0/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.2.0/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.versions/2.2.0/.pi/harnesses/lib/installation-state.js +62 -0
- package/.versions/2.2.0/.pi/harnesses/lib/peer-target.ts +24 -0
- package/.versions/2.2.0/.pi/harnesses/lib/policy-roots.js +117 -0
- package/.versions/2.2.0/.pi/harnesses/lib/policy-roots.ts +32 -0
- package/.versions/2.2.0/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/lib/resource-closure.js +26 -0
- package/.versions/2.2.0/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.2.0/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.versions/2.2.0/.pi/harnesses/lib/session-target.ts +62 -0
- package/.versions/2.2.0/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-loader.js +53 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-v2.js +112 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
- package/.versions/2.2.0/.pi/harnesses/lib/target-capabilities.js +7 -0
- package/.versions/2.2.0/.pi/harnesses/lib/update-check.ts +227 -0
- package/.versions/2.2.0/.pi/harnesses/lib/workspace-context.js +115 -0
- package/.versions/2.2.0/.pi/harnesses/lib/workspace-context.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/package-lock.json +2121 -0
- package/.versions/2.2.0/.pi/harnesses/package.json +13 -0
- package/.versions/2.2.0/.pi/prompts/af-build.md +27 -0
- package/.versions/2.2.0/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.2.0/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.2.0/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.2.0/.pi/prompts/af-review.md +16 -0
- package/.versions/2.2.0/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.2.0/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.2.0/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.2.0/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.2.0/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.2.0/.pi/prompts/af-test.md +19 -0
- package/.versions/2.2.0/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.2.0/.version +1 -0
- package/.versions/2.2.0/agents/architect.md +24 -0
- package/.versions/2.2.0/agents/bowser.md +28 -0
- package/.versions/2.2.0/agents/builder.md +55 -0
- package/.versions/2.2.0/agents/code-reviewer.md +209 -0
- package/.versions/2.2.0/agents/deep-researcher.md +32 -0
- package/.versions/2.2.0/agents/documenter.md +22 -0
- package/.versions/2.2.0/agents/plan-reviewer.md +83 -0
- package/.versions/2.2.0/agents/planner.md +107 -0
- package/.versions/2.2.0/agents/releaser.md +24 -0
- package/.versions/2.2.0/agents/researcher.md +30 -0
- package/.versions/2.2.0/agents/security-auditor.md +167 -0
- package/.versions/2.2.0/agents/test-engineer.md +153 -0
- package/.versions/2.2.0/agents/web-debugger.md +44 -0
- package/.versions/2.2.0/agents/web-performance-auditor.md +194 -0
- package/.versions/2.2.0/bin/catalog/harness-runtime-closure.json +85 -0
- package/.versions/2.2.0/docs/ARCHITECTURE.md +1291 -0
- package/.versions/2.2.0/docs/agent-fleet-setup.md +1161 -0
- package/.versions/2.2.0/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.2.0/docs/codex-local-mcp.md +520 -0
- package/.versions/2.2.0/docs/codex-session-bridge.md +44 -0
- package/.versions/2.2.0/docs/codex-setup.md +183 -0
- package/.versions/2.2.0/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.2.0/docs/fleet-native-voice.md +151 -0
- package/.versions/2.2.0/docs/getting-started.md +126 -0
- package/.versions/2.2.0/docs/npm-install.md +535 -0
- package/.versions/2.2.0/docs/pi-extensions.md +450 -0
- package/.versions/2.2.0/docs/pi-setup.md +92 -0
- package/.versions/2.2.0/docs/skill-anatomy.md +150 -0
- package/.versions/2.2.0/install-manifest.json +3226 -0
- package/.versions/2.2.0/justfile +246 -0
- package/.versions/2.2.0/manifest-meta.json +1098 -0
- package/.versions/2.2.0/references/accessibility-checklist.md +160 -0
- package/.versions/2.2.0/references/communication-contract.md +26 -0
- package/.versions/2.2.0/references/definition-of-done.md +67 -0
- package/.versions/2.2.0/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.2.0/references/observability-checklist.md +92 -0
- package/.versions/2.2.0/references/orchestration-patterns.md +370 -0
- package/.versions/2.2.0/references/performance-checklist.md +236 -0
- package/.versions/2.2.0/references/prompting-patterns.md +380 -0
- package/.versions/2.2.0/references/security-checklist.md +245 -0
- package/.versions/2.2.0/references/testing-patterns.md +235 -0
- package/.versions/2.2.0/references/workflow-authoring.md +304 -0
- package/.versions/2.2.0/skills/_internal/grilling.md +59 -0
- package/.versions/2.2.0/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.2.0/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.2.0/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.2.0/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.2.0/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.2.0/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.2.0/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.2.0/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.2.0/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.2.0/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.2.0/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.2.0/skills/fleet-connect/SKILL.md +29 -0
- package/.versions/2.2.0/skills/fleet-connect.zip +0 -0
- package/.versions/2.2.0/skills/fleet-native-voice/SKILL.md +103 -0
- package/.versions/2.2.0/skills/fleet-native-voice/agents/openai.yaml +4 -0
- package/.versions/2.2.0/skills/fleet-native-voice.zip +0 -0
- package/.versions/2.2.0/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.2.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.2.0/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.2.0/skills/idea-refine/examples.md +238 -0
- package/.versions/2.2.0/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.2.0/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.2.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.2.0/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.2.0/skills/incremental-implementation.zip +0 -0
- package/.versions/2.2.0/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.2.0/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.2.0/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.2.0/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.2.0/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.2.0/skills/planning-and-task-breakdown.zip +0 -0
- package/.versions/2.2.0/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.2.0/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.2.0/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.2.0/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.2.0/skills/spec-driven-development.zip +0 -0
- package/.versions/2.2.0/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +33 -0
- package/README.md +7 -10
- package/bin/lib/set-codex-mcp.js +1 -1
- package/bin/lib/validate-overrides.js +8 -1
- package/docs/ARCHITECTURE.md +122 -26
- package/docs/MIGRATION-agent-fleet.md +26 -5
- package/docs/agent-fleet-setup.md +44 -26
- package/docs/claude-code-coms-bridge.md +1 -1
- package/docs/codex-local-mcp.md +29 -12
- package/docs/codex-session-bridge.md +2 -2
- package/docs/codex-setup.md +1 -1
- package/docs/fleet-native-voice.md +10 -4
- package/docs/npm-install.md +1 -1
- package/docs/pi-extensions.md +13 -18
- package/docs/system1-agentic.md +1 -1
- package/docs/system1-file-discovery.md +2 -2
- package/docs/workflows.md +24 -1
- package/install-manifest.json +15 -28
- package/justfile +3 -4
- package/manifest-meta.json +13 -2
- package/package.json +4 -2
- package/skills/fleet-connect/SKILL.md +20 -16
- package/skills/fleet-connect.zip +0 -0
- package/skills/fleet-native-voice.zip +0 -0
- package/.pi/harnesses/agent-hub/commands/work-mode.ts +0 -29
- package/.pi/harnesses/agent-hub/work-mode-controls.ts +0 -56
- package/agents/orchestrator.md +0 -22
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { basePersonaName } from "./run-budget.js";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { worktreeRevision } from "./scope-gate.js";
|
|
6
|
+
import type { ProcessObligationState } from "./process-obligations.ts";
|
|
7
|
+
|
|
8
|
+
const reviewers=new Set(["code-reviewer","plan-reviewer","security-auditor"]);
|
|
9
|
+
const digest=(value:string|Uint8Array)=>createHash("sha256").update(value).digest("hex");
|
|
10
|
+
export interface ReviewInput { taskId:string; agent:string; scope:string[]; scopeRevision:string; contractHash:string; }
|
|
11
|
+
export interface ReviewEvidence extends ReviewInput { evidenceRef:string; evidenceHash:string; baselineRef?:string; baselineHash?:string; }
|
|
12
|
+
export function normalizeReviewEvidence(value:unknown):ReviewEvidence[] {
|
|
13
|
+
if(!Array.isArray(value))return [];
|
|
14
|
+
const valid=new Map<string,ReviewEvidence>();
|
|
15
|
+
for(const row of value){
|
|
16
|
+
if(!row||!reviewers.has(row.agent)||typeof row.taskId!=="string"||!row.taskId||!Array.isArray(row.scope)||!row.scope.length||!row.scope.every((s:unknown)=>typeof s==="string"&&s.length>0)||typeof row.evidenceRef!=="string"||!row.evidenceRef||![row.scopeRevision,row.contractHash,row.evidenceHash].every(v=>typeof v==="string"&&/^[a-f0-9]{64}$/.test(v)))continue;
|
|
17
|
+
valid.set(row.agent,{taskId:row.taskId,agent:row.agent,scope:[...row.scope],scopeRevision:row.scopeRevision,contractHash:row.contractHash,evidenceRef:row.evidenceRef,evidenceHash:row.evidenceHash,...(typeof row.baselineRef==="string" && /^[a-f0-9]{64}$/.test(row.baselineHash) ? {baselineRef:row.baselineRef,baselineHash:row.baselineHash} : {})});
|
|
18
|
+
}
|
|
19
|
+
return [...valid.values()];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** No model judgment: match complete declared coverage, requirement declarations,
|
|
23
|
+
* source additions, file state and the retained report's bytes. Unknown => rerun.
|
|
24
|
+
*/
|
|
25
|
+
export function reviewInput(cwd:string,taskId:string,agent:string,scope:string[],state:ProcessObligationState,requirements:readonly {id:string;tag?:string;text?:string;source?:string;reference?:string;criticalConditions?:string[];testCommand?:string;compilerCommand?:string}[],artifacts:{path:string}[],acceptedInput?:string):ReviewInput|null {
|
|
26
|
+
if(!reviewers.has(basePersonaName(agent))||!scope.length||!state.changedFiles.length)return null;
|
|
27
|
+
try {
|
|
28
|
+
const normalized=[...new Set(scope.map(s=>s.trim()).filter(Boolean))].sort();
|
|
29
|
+
const scopeRevision=worktreeRevision(cwd,normalized,normalized);
|
|
30
|
+
if(scopeRevision==="unavailable")return null;
|
|
31
|
+
const declarations=requirements.map(r=>({id:r.id,tag:r.tag,text:r.text,source:r.source,reference:r.reference,criticalConditions:r.criticalConditions,testCommand:r.testCommand,compilerCommand:r.compilerCommand})).sort((a,b)=>a.id.localeCompare(b.id));
|
|
32
|
+
const inputs=artifacts.map(a=>[a.path,digest(readFileSync(resolve(cwd,a.path)))]).sort(([a],[b])=>a.localeCompare(b));
|
|
33
|
+
return {taskId,agent,scope:normalized,scopeRevision,contractHash:digest(JSON.stringify({acceptedInput:acceptedInput===undefined?undefined:digest(acceptedInput),risk:state.risk,scope:state.scope,...(state.workOrigin?{workOrigin:state.workOrigin}:{}),changedFiles:[...state.changedFiles].sort(),additions:state.additions,requirements:declarations,inputs}))};
|
|
34
|
+
} catch { return null; }
|
|
35
|
+
}
|
|
36
|
+
export function retainReview(state:ProcessObligationState,input:ReviewInput|null,evidenceRef:string,cwd:string):ProcessObligationState {
|
|
37
|
+
if(!input)return state;
|
|
38
|
+
try {
|
|
39
|
+
const record={...input,evidenceRef,evidenceHash:digest(readFileSync(resolve(cwd,evidenceRef)))};
|
|
40
|
+
return {...state,reviews:[...(state.reviews??[]).filter(r=>r.agent!==input.agent),record]};
|
|
41
|
+
} catch { return state; }
|
|
42
|
+
}
|
|
43
|
+
export function reusableReview(state:ProcessObligationState,input:ReviewInput|null,cwd:string):ReviewEvidence|null {
|
|
44
|
+
if(!input||!state.review.evidenceRef)return null;
|
|
45
|
+
const record=state.reviews?.find(r=>r.agent===input.agent);
|
|
46
|
+
if(!record||record.taskId!==input.taskId||record.scopeRevision!==input.scopeRevision||record.contractHash!==input.contractHash||JSON.stringify(record.scope)!==JSON.stringify(input.scope))return null;
|
|
47
|
+
try{return digest(readFileSync(resolve(cwd,record.evidenceRef)))===record.evidenceHash?record:null;}catch{return null;}
|
|
48
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Native reviewer markdown is presentation, not a weaker acceptance contract.
|
|
2
|
+
// A recognized REJECT always vetoes APPROVE; incidental prose/JSON is not a verdict.
|
|
3
|
+
export function affirmativeReviewVerdict(output:string):boolean {
|
|
4
|
+
const verdicts=Array.from(output.matchAll(/(?:^|\n)[ \t]*(?:(?:Verdict[ \t]*:|\*\*Verdict:\*\*|\*\*Verdict\*\*:)[ \t]*)?(APPROVE|REJECT)\b/gi),m=>m[1].toUpperCase());
|
|
5
|
+
return verdicts.includes('APPROVE')&&!verdicts.includes('REJECT');
|
|
6
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface RoutingObservationInput {
|
|
2
|
+
taskClass: string;
|
|
3
|
+
model: string;
|
|
4
|
+
wallMs: number;
|
|
5
|
+
toolTestMs?: number;
|
|
6
|
+
retries: number;
|
|
7
|
+
refusals: number;
|
|
8
|
+
contractCompliant: boolean;
|
|
9
|
+
accepted: boolean;
|
|
10
|
+
payload?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RoutingObservation {
|
|
14
|
+
taskClass: string;
|
|
15
|
+
model: string;
|
|
16
|
+
wallMs: number;
|
|
17
|
+
toolTestMs: number | "unknown";
|
|
18
|
+
retries: number;
|
|
19
|
+
refusals: number;
|
|
20
|
+
contractCompliant: boolean;
|
|
21
|
+
accepted: boolean;
|
|
22
|
+
missingDimensions: string[];
|
|
23
|
+
routingChanged: false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function recordRoutingObservation(input: RoutingObservationInput): RoutingObservation {
|
|
27
|
+
const toolTestMs = typeof input.toolTestMs === "number" ? input.toolTestMs : "unknown";
|
|
28
|
+
const missingDimensions = toolTestMs === "unknown" ? ["toolTestMs"] : [];
|
|
29
|
+
return {
|
|
30
|
+
taskClass: input.taskClass,
|
|
31
|
+
model: input.model,
|
|
32
|
+
wallMs: input.wallMs,
|
|
33
|
+
toolTestMs,
|
|
34
|
+
retries: input.retries,
|
|
35
|
+
refusals: input.refusals,
|
|
36
|
+
contractCompliant: input.contractCompliant,
|
|
37
|
+
accepted: input.accepted,
|
|
38
|
+
missingDimensions,
|
|
39
|
+
routingChanged: false,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface RoutingProposalInput {
|
|
2
|
+
taskClass: string;
|
|
3
|
+
model: string;
|
|
4
|
+
maxWallMs: number;
|
|
5
|
+
previousModel: string;
|
|
6
|
+
evidenceRef?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface RoutingProposal {
|
|
10
|
+
taskClass: string;
|
|
11
|
+
model: string;
|
|
12
|
+
maxWallMs: number;
|
|
13
|
+
previousModel: string;
|
|
14
|
+
evidenceRef?: string;
|
|
15
|
+
active: false;
|
|
16
|
+
fallback: false;
|
|
17
|
+
acceptanceWeakened: false;
|
|
18
|
+
requiresApproval: true;
|
|
19
|
+
shadowCompared: true;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function proposeRoutingPolicy(input: RoutingProposalInput): RoutingProposal {
|
|
23
|
+
return {
|
|
24
|
+
taskClass: input.taskClass,
|
|
25
|
+
model: input.model,
|
|
26
|
+
maxWallMs: input.maxWallMs,
|
|
27
|
+
previousModel: input.previousModel,
|
|
28
|
+
...(input.evidenceRef ? { evidenceRef: input.evidenceRef } : {}),
|
|
29
|
+
active: false,
|
|
30
|
+
fallback: false,
|
|
31
|
+
acceptanceWeakened: false,
|
|
32
|
+
requiresApproval: true,
|
|
33
|
+
shadowCompared: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function shadowCompare(proposal: RoutingProposal, observations: { taskClass: string; toolTestMs: number | "unknown" }[]): { activate: false; reason: string } {
|
|
38
|
+
const same = observations.filter(item => item.taskClass === proposal.taskClass);
|
|
39
|
+
if (!same.length) return { activate: false, reason: "no observations for the same task class" };
|
|
40
|
+
if (same.some(item => item.toolTestMs === "unknown")) return { activate: false, reason: "same task class still has an unknown model-versus-test split" };
|
|
41
|
+
return { activate: false, reason: "shadow comparison recorded; maintainer approval is still required" };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function rollbackRoutingPolicy(proposal: RoutingProposal): RoutingProposal {
|
|
45
|
+
return { ...proposal, model: proposal.previousModel, active: false };
|
|
46
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
// Usage accounting and task-tier policy. Dispatch/research counts and task/turn
|
|
2
|
+
// duration are observable, never continuation quotas. Individual child deadlines,
|
|
3
|
+
// cancellation and context recycling still bound a physical run.
|
|
4
|
+
|
|
5
|
+
// Task tiers — the dispatcher's complexity triage, child deadlines and delegation.
|
|
6
|
+
// Unset/junk tier is treated as DEFAULT_TASK_TIER (`small`).
|
|
7
|
+
export const TASK_TIERS = ["trivial", "small", "feature", "project"];
|
|
8
|
+
// The tier ASSUMED when the dispatcher never called set_task_tier. It is
|
|
9
|
+
// deliberately not the middle of the range: the tier is task-scoped, so a skipped
|
|
10
|
+
// triage latches for the whole task, and skipped triage is exactly the case where
|
|
11
|
+
// the dispatcher was not thinking about proportionality. Assuming `feature` there
|
|
12
|
+
// unlocked planner/plan-reviewer/security-auditor, loosened the review cap, and
|
|
13
|
+
// handed out the full feature envelope — the over-apparatus failure mode, granted
|
|
14
|
+
// by forgetting a tool call. Assuming `small` costs an explicit escalation (with a
|
|
15
|
+
// reason) when the work really is bigger, which is the cheap direction to be wrong in.
|
|
16
|
+
export const DEFAULT_TASK_TIER = "small";
|
|
17
|
+
|
|
18
|
+
/** "Small", " TRIVIAL " → canonical tier name, or null when unrecognized. */
|
|
19
|
+
export function normalizeTaskTier(value) {
|
|
20
|
+
const v = String(value ?? "").trim().toLowerCase();
|
|
21
|
+
return TASK_TIERS.includes(v) ? v : null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Session-recycle context threshold (percent, measured over input+cacheRead+
|
|
25
|
+
// cacheWrite): beyond this, resuming the specialist session mostly re-bills
|
|
26
|
+
// stale context, so a fresh session is cheaper than the memory is worth.
|
|
27
|
+
export const RECYCLE_CONTEXT_PCT = 60;
|
|
28
|
+
|
|
29
|
+
// Hard ceiling: at or past a full window the accumulated session no longer
|
|
30
|
+
// fits, so no threshold override may keep it alive. Session 1 of the
|
|
31
|
+
// post-mortem logged 315% → 176% → 100% while the configured threshold was
|
|
32
|
+
// still being consulted as if it were advisory.
|
|
33
|
+
export const HARD_RECYCLE_CONTEXT_PCT = 100;
|
|
34
|
+
|
|
35
|
+
export const TIER_BUDGETS = {
|
|
36
|
+
trivial: {
|
|
37
|
+
agentTurnMs: 10 * 60_000,
|
|
38
|
+
recycleRuns: 3,
|
|
39
|
+
delegation: false,
|
|
40
|
+
},
|
|
41
|
+
small: {
|
|
42
|
+
agentTurnMs: 10 * 60_000,
|
|
43
|
+
recycleRuns: 3,
|
|
44
|
+
delegation: false,
|
|
45
|
+
},
|
|
46
|
+
feature: {
|
|
47
|
+
agentTurnMs: 30 * 60_000,
|
|
48
|
+
recycleRuns: 5,
|
|
49
|
+
delegation: true,
|
|
50
|
+
},
|
|
51
|
+
project: {
|
|
52
|
+
agentTurnMs: 30 * 60_000,
|
|
53
|
+
recycleRuns: 5,
|
|
54
|
+
delegation: true,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** Legacy quota overrides are ignored. Only child deadlines and recycling are configurable. */
|
|
59
|
+
export function resolveTurnBudget(tier, overrides = {}) {
|
|
60
|
+
const base = TIER_BUDGETS[normalizeTaskTier(tier) ?? DEFAULT_TASK_TIER];
|
|
61
|
+
const ceiling = (key) => {
|
|
62
|
+
const override = overrides[key];
|
|
63
|
+
if (override === undefined || override === null) return base[key];
|
|
64
|
+
if (base[key] == null) return override;
|
|
65
|
+
return Math.min(base[key], override);
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
agentTurnMs: ceiling("agentTurnMs"),
|
|
69
|
+
recycleRuns: ceiling("recycleRuns"),
|
|
70
|
+
delegation: base.delegation,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Recycle the specialist's accumulated session before this run? True when the
|
|
76
|
+
* session already served `recycleRuns` runs, its context reached a full window
|
|
77
|
+
* (HARD_RECYCLE_CONTEXT_PCT, not overridable), or it passed the configured
|
|
78
|
+
* RECYCLE_CONTEXT_PCT — resuming past any of those mostly re-bills stale
|
|
79
|
+
* context on every subsequent model call.
|
|
80
|
+
*/
|
|
81
|
+
export function shouldRecycleSession(runsSinceFresh, contextPct, budget, thresholdPct = RECYCLE_CONTEXT_PCT) {
|
|
82
|
+
if (runsSinceFresh <= 0) return false;
|
|
83
|
+
if (contextPct >= HARD_RECYCLE_CONTEXT_PCT) return true;
|
|
84
|
+
if (budget.recycleRuns != null && runsSinceFresh >= budget.recycleRuns) return true;
|
|
85
|
+
return contextPct >= thresholdPct;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The one case recycling cannot fix: a *fresh* session already measured over a
|
|
90
|
+
* full window means a single run overflowed on its own, so there is no
|
|
91
|
+
* accumulated history to drop. Either `contextWindow` is wrong for that
|
|
92
|
+
* provider or the run genuinely ran over — both need a human, not a retry.
|
|
93
|
+
* Returns the diagnostic line, or null when recycling covers the situation.
|
|
94
|
+
*/
|
|
95
|
+
export function contextOverflowDiagnostic(runsSinceFresh, contextPct, { agent = "agent", model = "unknown model" } = {}) {
|
|
96
|
+
if (runsSinceFresh > 0) return null;
|
|
97
|
+
if (!(contextPct >= HARD_RECYCLE_CONTEXT_PCT)) return null;
|
|
98
|
+
return (
|
|
99
|
+
`⚠ ${agent} measured ${Math.round(contextPct)}% context on a fresh session (${model}) — ` +
|
|
100
|
+
"recycling cannot help, one run overflowed the window on its own. Either the resolved " +
|
|
101
|
+
"contextWindow is wrong for this provider or the run genuinely ran over: check the model's " +
|
|
102
|
+
"declared window and narrow the task's inputs."
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** One-line usage chip: "Tier: small · 1 disp · 0 res · task 4 disp". Counts, never quotas.
|
|
107
|
+
* @param {{dispatches: number, research: number}} counters this turn
|
|
108
|
+
* @param {string|null} [tier]
|
|
109
|
+
* @param {{dispatches: number}|null} [task] counts for the whole task
|
|
110
|
+
*/
|
|
111
|
+
export function budgetStatusLine(counters, tier = null, task = null) {
|
|
112
|
+
const taskSuffix = task ? ` · task ${task.dispatches} disp` : "";
|
|
113
|
+
return `Tier: ${tier || DEFAULT_TASK_TIER} · ${counters.dispatches} disp · ${counters.research} res${taskSuffix}`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
117
|
+
// Tier ratchet (the tier is TASK-scoped, not turn-scoped)
|
|
118
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
119
|
+
//
|
|
120
|
+
// Turn-scoped tiers cannot bind on a steered run: every follow-up message reset
|
|
121
|
+
// the tier to null, the next dispatch re-assumed `feature`, and a two-word
|
|
122
|
+
// correction ("no, only the one line") bought six fresh dispatches. Worse, the
|
|
123
|
+
// reset direction was always upward — nobody re-declares `trivial` after a
|
|
124
|
+
// steering message, so the effective tier drifted to the ceiling.
|
|
125
|
+
//
|
|
126
|
+
// The tier now survives the turn and moves by ratchet: DOWN is free (cheap and
|
|
127
|
+
// self-limiting), UP costs an explicit reason that is recorded and shown. Only
|
|
128
|
+
// an explicit new task (`set_task_tier` with `new_task: true`) clears it.
|
|
129
|
+
|
|
130
|
+
export const TIER_RANK = { trivial: 0, small: 1, feature: 2, project: 3 };
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Move the task tier from `current` to `next`.
|
|
134
|
+
* Returns { ok, tier, escalated, reason, message }: `tier` is always the tier
|
|
135
|
+
* that should be in force afterwards, so a refused escalation keeps the old one.
|
|
136
|
+
*/
|
|
137
|
+
export function applyTierChange(current, next, reason = "") {
|
|
138
|
+
const target = normalizeTaskTier(next);
|
|
139
|
+
if (!target) {
|
|
140
|
+
return {
|
|
141
|
+
ok: false,
|
|
142
|
+
tier: current ?? null,
|
|
143
|
+
escalated: false,
|
|
144
|
+
reason: "unknown_tier",
|
|
145
|
+
message: `Unknown tier "${next}" — expected one of: ${TASK_TIERS.join(", ")}. ` +
|
|
146
|
+
`Tier unchanged (${current ?? "unset"}).`,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
const from = normalizeTaskTier(current);
|
|
150
|
+
if (!from) {
|
|
151
|
+
return { ok: true, tier: target, escalated: false, reason: "initial", message: `Task tier: ${target}.` };
|
|
152
|
+
}
|
|
153
|
+
if (TIER_RANK[target] <= TIER_RANK[from]) {
|
|
154
|
+
return {
|
|
155
|
+
ok: true,
|
|
156
|
+
tier: target,
|
|
157
|
+
escalated: false,
|
|
158
|
+
reason: TIER_RANK[target] === TIER_RANK[from] ? "unchanged" : "lowered",
|
|
159
|
+
message: `Task tier: ${from} → ${target}.`,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (!String(reason || "").trim()) {
|
|
163
|
+
return {
|
|
164
|
+
ok: false,
|
|
165
|
+
tier: from,
|
|
166
|
+
escalated: false,
|
|
167
|
+
reason: "raise_without_reason",
|
|
168
|
+
message: `⚠ Tier escalation ${from} → ${target} refused: raising the tier needs an explicit ` +
|
|
169
|
+
"`reason` naming what the ask turned out to contain that the lower tier does not cover. " +
|
|
170
|
+
`Tier stays ${from}. Lowering the tier never needs a reason.`,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
ok: true,
|
|
175
|
+
tier: target,
|
|
176
|
+
escalated: true,
|
|
177
|
+
reason: "raised",
|
|
178
|
+
message: `⚠ Task tier ESCALATED ${from} → ${target}: ${String(reason).trim()}`,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
183
|
+
// Task clock — active time is visible accounting, never a continuation quota
|
|
184
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* ACTIVE milliseconds in one turn: wall clock minus the time the human was away.
|
|
188
|
+
* A lunch break, an overnight pause or a long `ask_user` answer is not fleet work,
|
|
189
|
+
* so the reported task duration excludes it.
|
|
190
|
+
*/
|
|
191
|
+
export function turnActiveMs(turnStartedAt, now, askUserWaitMs = 0) {
|
|
192
|
+
if (!turnStartedAt) return 0;
|
|
193
|
+
return Math.max(0, now - turnStartedAt - Math.max(0, askUserWaitMs || 0));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** A serializable, deterministic task clock. `active` is authoritative. */
|
|
197
|
+
export function createTaskClock() {
|
|
198
|
+
return { active: false, accumulatedMs: 0, turnStartedAt: 0, askUserWaitMs: 0 };
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Open a task turn. A still-open prior interval is closed first as defensive
|
|
203
|
+
* recovery for a missing end event; normal turns are closed by agent_end.
|
|
204
|
+
*/
|
|
205
|
+
export function openTaskClock(clock, now) {
|
|
206
|
+
const base = clock?.active ? closeTaskClock(clock, now) : { ...createTaskClock(), ...clock };
|
|
207
|
+
return { ...base, active: true, turnStartedAt: now, askUserWaitMs: 0 };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** Add a completed ask_user wait to the currently open turn. */
|
|
211
|
+
export function addTaskClockWait(clock, waitMs) {
|
|
212
|
+
if (!clock?.active) return { ...createTaskClock(), ...clock };
|
|
213
|
+
return {
|
|
214
|
+
...clock,
|
|
215
|
+
askUserWaitMs: Math.max(0, clock.askUserWaitMs || 0) + Math.max(0, waitMs || 0),
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Finished turns plus the open turn, excluding completed and in-flight waits. */
|
|
220
|
+
export function taskClockElapsedMs(clock, now, openWaitMs = 0) {
|
|
221
|
+
if (!clock) return 0;
|
|
222
|
+
const accumulated = Math.max(0, clock.accumulatedMs || 0);
|
|
223
|
+
if (!clock.active) return accumulated;
|
|
224
|
+
return accumulated + turnActiveMs(
|
|
225
|
+
clock.turnStartedAt,
|
|
226
|
+
now,
|
|
227
|
+
Math.max(0, clock.askUserWaitMs || 0) + Math.max(0, openWaitMs || 0),
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** Close the current turn once. Repeated closes are no-ops. */
|
|
232
|
+
export function closeTaskClock(clock, now) {
|
|
233
|
+
const base = { ...createTaskClock(), ...clock };
|
|
234
|
+
if (!base.active) return base;
|
|
235
|
+
return {
|
|
236
|
+
active: false,
|
|
237
|
+
accumulatedMs: taskClockElapsedMs(base, now),
|
|
238
|
+
turnStartedAt: 0,
|
|
239
|
+
askUserWaitMs: 0,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Open a fresh task window. During an active turn, the new task begins at the
|
|
245
|
+
* reset instant; between turns, no timestamp is carried into the next task.
|
|
246
|
+
*/
|
|
247
|
+
export function resetTaskClock(clock, now) {
|
|
248
|
+
const active = clock?.active === true;
|
|
249
|
+
return {
|
|
250
|
+
active,
|
|
251
|
+
accumulatedMs: 0,
|
|
252
|
+
turnStartedAt: active ? now : 0,
|
|
253
|
+
askUserWaitMs: 0,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
258
|
+
// Tier persona gate (B3) — heavy apparatus is not available at low tiers
|
|
259
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
260
|
+
//
|
|
261
|
+
// "A trivial ask gets one specialist" was prose in the system prompt, and prose
|
|
262
|
+
// lost: a one-line Azure permission change was routed through planner →
|
|
263
|
+
// plan-reviewer → security-auditor and grew a 1216-line plan. These personas
|
|
264
|
+
// each open a pipeline (plans, reviews, findings that ratchet back into the
|
|
265
|
+
// plan), so at trivial/small tiers they are refused in code. The escape hatch is
|
|
266
|
+
// the honest one: raise the tier with a reason.
|
|
267
|
+
|
|
268
|
+
export const HEAVY_PERSONAS = ["architect", "security-auditor", "deep-researcher"];
|
|
269
|
+
export const REVIEW_PERSONAS = ["code-reviewer", "plan-reviewer", "security-auditor"];
|
|
270
|
+
const GATED_TIERS = new Set(["trivial", "small"]);
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Refuse a heavy persona at a low tier. Returns null when allowed, else
|
|
274
|
+
* { reason, message }. Unknown/absent tier never gates here; the harness assumes
|
|
275
|
+
* DEFAULT_TASK_TIER before calling.
|
|
276
|
+
*/
|
|
277
|
+
export function checkTierPersonaGate(tier, persona) {
|
|
278
|
+
const t = normalizeTaskTier(tier);
|
|
279
|
+
if (!t || !GATED_TIERS.has(t)) return null;
|
|
280
|
+
const name = basePersonaName(persona);
|
|
281
|
+
if (!HEAVY_PERSONAS.includes(name)) return null;
|
|
282
|
+
return {
|
|
283
|
+
reason: "tier_persona_gate",
|
|
284
|
+
message: `⚠ ${name} is not available at tier "${t}" — and this dispatch was NOT counted against any budget.\n` +
|
|
285
|
+
`At trivial/small tiers the apparatus is one specialist plus its own evidence: no planning pipeline, ` +
|
|
286
|
+
`no plan review, no separate audit pass. Each of those personas opens a document/finding loop whose ` +
|
|
287
|
+
`output then has to be executed and re-reviewed.\n` +
|
|
288
|
+
`Either dispatch the specialist that does the actual work (builder, test-engineer, code-reviewer, ` +
|
|
289
|
+
`documenter), or — if the ask really is bigger than "${t}" — call set_task_tier with a higher tier ` +
|
|
290
|
+
`AND a reason naming what it turned out to contain. Do not raise the tier merely to unlock a persona.`,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
295
|
+
// Review finding budget (B6) — a review is a gate, and a gate has a size
|
|
296
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
297
|
+
//
|
|
298
|
+
// Unbounded review authority is a ratchet: every round produced new blocking
|
|
299
|
+
// findings, each finding added an invariant to the plan, and the enlarged plan
|
|
300
|
+
// justified another round. PLAN37 recorded P37-001…011, R37-IMM-001 and six
|
|
301
|
+
// script-review remediations — none of which the user asked for. The cap is on
|
|
302
|
+
// BLOCKING findings only; everything else still gets reported, just not as a gate.
|
|
303
|
+
|
|
304
|
+
export const BLOCKING_FINDING_CAPS = { trivial: 1, small: 2, feature: 5, project: null };
|
|
305
|
+
|
|
306
|
+
// Review rounds are observable, never a continuation quota; independent review
|
|
307
|
+
// evidence is unchanged.
|
|
308
|
+
|
|
309
|
+
/** Blocking-finding cap for a tier; null = uncapped (project / unset tier). */
|
|
310
|
+
export function blockingFindingCap(tier) {
|
|
311
|
+
const t = normalizeTaskTier(tier);
|
|
312
|
+
if (!t) return null;
|
|
313
|
+
return BLOCKING_FINDING_CAPS[t] ?? null;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Is this a review persona (gets the finding-budget clause)? */
|
|
317
|
+
/** Reserved infix of a parallel persona instance: builder--p2 ... builder--p16. */
|
|
318
|
+
export const PARALLEL_INSTANCE_INFIX = "--p";
|
|
319
|
+
|
|
320
|
+
/** The instance name for slot n (2..16) of a persona. */
|
|
321
|
+
export function parallelInstanceName(persona, n) {
|
|
322
|
+
return `${String(persona || "").trim().toLowerCase()}${PARALLEL_INSTANCE_INFIX}${n}`;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* The persona a parallel instance was cloned from; any other name is returned
|
|
327
|
+
* normalized. Role rules use it so an instance keeps the base persona's review
|
|
328
|
+
* meaning and tier gates. Agent keys are slugs, so the instance marker is the
|
|
329
|
+
* reserved `--p<n>` suffix rather than a plain `-<n>` that a real name may use.
|
|
330
|
+
*/
|
|
331
|
+
export function basePersonaName(persona) {
|
|
332
|
+
const name = String(persona || "").trim().toLowerCase();
|
|
333
|
+
const match = /^(.+)--p([2-9]|1[0-6])$/.exec(name);
|
|
334
|
+
return match ? match[1] : name;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export function isReviewPersona(persona) {
|
|
338
|
+
return REVIEW_PERSONAS.includes(basePersonaName(persona));
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The finding-budget clause appended to a review persona's task text.
|
|
343
|
+
* Returns null when the persona is not a reviewer or the tier is uncapped.
|
|
344
|
+
*/
|
|
345
|
+
export function reviewBudgetClause(tier, persona) {
|
|
346
|
+
if (!isReviewPersona(persona)) return null;
|
|
347
|
+
const cap = blockingFindingCap(tier);
|
|
348
|
+
if (cap == null) return null;
|
|
349
|
+
return [
|
|
350
|
+
`## Finding budget (task tier: ${normalizeTaskTier(tier)})`,
|
|
351
|
+
``,
|
|
352
|
+
`Report at most ${cap} BLOCKING finding${cap === 1 ? "" : "s"}. Rank by severity and put everything`,
|
|
353
|
+
`else under a "## Non-blocking (optional)" heading — non-blocking findings are advice, and must not`,
|
|
354
|
+
`gate the change or be re-raised as blockers in a later round.`,
|
|
355
|
+
``,
|
|
356
|
+
`A blocking finding may only enforce an invariant the task, the plan, or the project rules ALREADY`,
|
|
357
|
+
`state. It may NOT introduce a new invariant, a new evidence artifact, a new script/manifest/fixture,`,
|
|
358
|
+
`or a new process requirement — that is scope growth wearing a reviewer's hat. If you believe a new`,
|
|
359
|
+
`invariant is genuinely needed, write it under "## Non-blocking (optional)" as a recommendation for`,
|
|
360
|
+
`the human to decide, and do not block on it.`,
|
|
361
|
+
].join("\n");
|
|
362
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Immutable per-run artifact namespaces — the pure policy core behind "a run's
|
|
2
|
+
// artifacts are never overwritten by the next run".
|
|
3
|
+
//
|
|
4
|
+
// The observed failure: `.pi/agent-sessions/artifacts/` was deleted at session
|
|
5
|
+
// start, and specialist returns were named by a per-session counter
|
|
6
|
+
// (`returns/builder-run1.md`). Two consequences, both hit at once: a later
|
|
7
|
+
// session's `builder-run1.md` occupied the same path as an earlier one, and the
|
|
8
|
+
// start-of-session wipe removed eleven implementation returns and two review
|
|
9
|
+
// artifacts that a post-mortem then had to record as NOT RECOVERABLE.
|
|
10
|
+
//
|
|
11
|
+
// The fix is not retention-by-luck: each session archives the previous session's
|
|
12
|
+
// artifacts into `runs/<runId>/`, a namespace that is written once and never
|
|
13
|
+
// reused, and records it in `runs/index.json`. Pruning is explicit and bounded,
|
|
14
|
+
// so the directory cannot grow without limit either.
|
|
15
|
+
|
|
16
|
+
export const DEFAULT_RUN_HISTORY_KEEP = 10;
|
|
17
|
+
export const RUNS_DIRNAME = "runs";
|
|
18
|
+
export const RUN_INDEX_FILENAME = "index.json";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Run id: sortable UTC timestamp + a short random suffix, so two sessions
|
|
22
|
+
* starting in the same second still get distinct namespaces.
|
|
23
|
+
* `2026-08-03T09-10-42-a3f9`
|
|
24
|
+
*/
|
|
25
|
+
export function makeRunId(date = new Date(), suffix = null) {
|
|
26
|
+
const iso = new Date(date).toISOString().replace(/\.\d+Z$/, "").replace(/:/g, "-");
|
|
27
|
+
const tail = suffix ?? Math.random().toString(36).slice(2, 6);
|
|
28
|
+
return `${iso}-${tail}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** A run id we generated (used to filter stray directories out of `runs/`). */
|
|
32
|
+
export function isRunId(name) {
|
|
33
|
+
return /^\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-[a-z0-9]{2,8}$/.test(String(name || ""));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Which run directories to delete so at most `keep` survive.
|
|
38
|
+
* Run ids sort lexicographically by time, so newest = last. `keep: null`
|
|
39
|
+
* ("off") prunes nothing; non-run-id entries are never touched.
|
|
40
|
+
* @param {string[]} names
|
|
41
|
+
* @param {number|null} [keep]
|
|
42
|
+
*/
|
|
43
|
+
export function pruneRunDirs(names, keep = DEFAULT_RUN_HISTORY_KEEP) {
|
|
44
|
+
if (keep == null) return [];
|
|
45
|
+
const runs = (names || []).filter(isRunId).sort();
|
|
46
|
+
const limit = Math.max(0, keep);
|
|
47
|
+
if (runs.length <= limit) return [];
|
|
48
|
+
return runs.slice(0, runs.length - limit);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The metadata written once into `runs/<runId>/meta.json`. Carries the
|
|
53
|
+
* identifiers a post-mortem needs and could not previously recover: which
|
|
54
|
+
* workspace/project/repo the run belonged to, and when it started and ended.
|
|
55
|
+
* @param {{runId: string, startedAt?: string|number|null, archivedAt?: string|number, cwd?: string|null, project?: string|null, workspace?: string|null, artifactCounts?: Record<string,number>|null}} input
|
|
56
|
+
*/
|
|
57
|
+
export function buildRunMeta({ runId, startedAt = null, archivedAt = Date.now(), cwd = null, project = null, workspace = null, artifactCounts = null }) {
|
|
58
|
+
return {
|
|
59
|
+
runId,
|
|
60
|
+
startedAt: startedAt == null ? null : new Date(startedAt).toISOString(),
|
|
61
|
+
archivedAt: new Date(archivedAt).toISOString(),
|
|
62
|
+
cwd,
|
|
63
|
+
project,
|
|
64
|
+
workspace,
|
|
65
|
+
artifactCounts,
|
|
66
|
+
note: "Immutable archive of one agent-hub session's artifacts. Written once; never rewritten.",
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Fold a run entry into `runs/index.json`, newest last, capped at `keep`.
|
|
72
|
+
* Re-indexing the same runId replaces its entry rather than duplicating it.
|
|
73
|
+
* @param {any} existing JSON read from disk; its shape is checked before use.
|
|
74
|
+
* @param {{runId: string, [key: string]: unknown}} entry
|
|
75
|
+
* @param {number|null} [keep]
|
|
76
|
+
*/
|
|
77
|
+
export function appendRunIndex(existing, entry, keep = DEFAULT_RUN_HISTORY_KEEP) {
|
|
78
|
+
const runs = Array.isArray(existing?.runs) ? existing.runs.filter((r) => r && r.runId !== entry.runId) : [];
|
|
79
|
+
runs.push(entry);
|
|
80
|
+
runs.sort((a, b) => String(a.runId).localeCompare(String(b.runId)));
|
|
81
|
+
const trimmed = keep == null ? runs : runs.slice(Math.max(0, runs.length - Math.max(0, keep)));
|
|
82
|
+
return { version: 1, updatedAt: new Date().toISOString(), runs: trimmed };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Parse the `run-history-keep:` overrides value → number, null ("off"), or undefined. */
|
|
86
|
+
export function normalizeRunHistoryKeep(value) {
|
|
87
|
+
const raw = String(value ?? "").trim().toLowerCase();
|
|
88
|
+
if (!raw) return undefined;
|
|
89
|
+
if (raw === "off" || raw === "none" || raw === "0") return null;
|
|
90
|
+
const n = Number(raw);
|
|
91
|
+
if (!Number.isFinite(n) || n < 1) return undefined;
|
|
92
|
+
return Math.floor(n);
|
|
93
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { lstatSync, readFileSync, realpathSync } from "node:fs";
|
|
3
|
+
import { isAbsolute, relative, resolve } from "node:path";
|
|
4
|
+
import type { AcceptanceRequirement, VerificationCheckInput } from "./acceptance.ts";
|
|
5
|
+
|
|
6
|
+
const hash = (value: string | Buffer) => createHash("sha256").update(value).digest("hex");
|
|
7
|
+
const hex = (value: unknown): value is string => typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
8
|
+
export interface ReceiptCapture {
|
|
9
|
+
taskId: string; generation: string; sessionDir: string; scope: string[]; declarationHash: string;
|
|
10
|
+
epoch: number; captureId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RuntimeReceipt extends ReceiptCapture {
|
|
13
|
+
originDispatchId: string; backend: "native"; capturedAt: number;
|
|
14
|
+
check: VerificationCheckInput; evidenceHash: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RuntimeReceiptState { generation: string; epoch: number; pending: string[]; records: RuntimeReceipt[]; }
|
|
17
|
+
|
|
18
|
+
/** Journal metadata only; there is deliberately no artifact/log import API. */
|
|
19
|
+
export function normalizeRuntimeReceipts(value: unknown): RuntimeReceiptState | undefined {
|
|
20
|
+
if (value === undefined) return undefined;
|
|
21
|
+
const row = value as RuntimeReceiptState;
|
|
22
|
+
if (!row || typeof row.generation !== "string" || !row.generation || !Number.isSafeInteger(row.epoch) || row.epoch < 0 || !Array.isArray(row.pending) || row.pending.length > 64 || !row.pending.every(id => typeof id === "string" && !!id) || !Array.isArray(row.records) || row.records.length > 64 || Buffer.byteLength(JSON.stringify(row)) > 256 * 1024) throw Error("Invalid runtime receipt journal; dependent effects are blocked.");
|
|
23
|
+
for (const r of row.records) {
|
|
24
|
+
if (!r || r.generation !== row.generation || typeof r.taskId !== "string" || !r.taskId || typeof r.captureId !== "string" || !r.captureId || typeof r.sessionDir !== "string" || !isAbsolute(r.sessionDir) || !Array.isArray(r.scope) || !r.scope.every(s => typeof s === "string") || !hex(r.declarationHash) || r.epoch !== row.epoch || r.backend !== "native" || typeof r.originDispatchId !== "string" || !r.originDispatchId || !Number.isSafeInteger(r.capturedAt) || r.capturedAt <= 0 || !hex(r.evidenceHash) || !["test", "code-grep", "compilation"].includes(r.check?.kind ?? "") || r.check?.producer !== "runtime" || r.check.taskId !== r.taskId || r.check.exitCode !== 0 || !hex(r.check.inspectedRevision) || !Array.isArray(r.check.command) || r.check.command.length !== 1 || typeof r.check.command[0] !== "string" || !r.check.command[0] || typeof r.check.evidenceRef !== "string" || !Array.isArray(r.check.requirementIds) || !Array.isArray(r.check.coverage)) throw Error("Invalid runtime receipt anchor; dependent effects are blocked.");
|
|
25
|
+
}
|
|
26
|
+
return structuredClone(row);
|
|
27
|
+
}
|
|
28
|
+
export function receiptDeclarationHash(requirements: AcceptanceRequirement[], scope: string[], acceptedInput?: string, artifacts: { path: string }[] = []): string {
|
|
29
|
+
return hash(JSON.stringify({ acceptedInput, scope, artifacts: artifacts.map(a => ({ path: a.path, hash: hash(readFileSync(a.path)) })), requirements: requirements.map(r => ({ id:r.id, tag:r.tag, text:r.text, source:r.source, reference:r.reference, criticalConditions:r.criticalConditions ?? [], testCommand:r.testCommand, compilerCommand:r.compilerCommand })) }));
|
|
30
|
+
}
|
|
31
|
+
export function beginReceiptCapture(previous: RuntimeReceiptState | undefined, input: Omit<ReceiptCapture, "generation" | "epoch" | "captureId">, exclusive: boolean): { state: RuntimeReceiptState; capture: ReceiptCapture } {
|
|
32
|
+
const state = normalizeRuntimeReceipts(previous) ?? { generation: randomUUID(), epoch: 0, pending: [], records: [] };
|
|
33
|
+
// An unresolved capture (including a resumed crash) or overlap cannot lend success.
|
|
34
|
+
if (!exclusive || state.pending.length) { state.epoch++; state.records = []; }
|
|
35
|
+
// The caller's existing admission/settlement gates remain authoritative. Once
|
|
36
|
+
// no live writer exists, stale capture markers fence history, not fresh checks.
|
|
37
|
+
if (exclusive) state.pending = [];
|
|
38
|
+
if (state.pending.length >= 64) throw Error("Runtime receipt capture limit reached");
|
|
39
|
+
const capture = { ...input, generation: state.generation, epoch: state.epoch, captureId: randomUUID() };
|
|
40
|
+
state.pending.push(capture.captureId);
|
|
41
|
+
return { state, capture };
|
|
42
|
+
}
|
|
43
|
+
function evidenceBytes(sessionDir: string, path: string): Buffer {
|
|
44
|
+
const base = realpathSync(sessionDir), root = resolve(base, "artifacts/evidence"), file = resolve(path);
|
|
45
|
+
const rel = relative(root, file);
|
|
46
|
+
if (!rel || rel.startsWith("..") || isAbsolute(rel) || realpathSync(root) !== root || realpathSync(file) !== file || !lstatSync(file).isFile() || lstatSync(file).size > 256 * 1024) throw Error("Runtime receipt evidence outside capture root");
|
|
47
|
+
return readFileSync(file);
|
|
48
|
+
}
|
|
49
|
+
export function runtimeReceiptEvidenceCurrent(receipt: RuntimeReceipt): boolean {
|
|
50
|
+
try { return hash(evidenceBytes(receipt.sessionDir, receipt.check.evidenceRef)) === receipt.evidenceHash; } catch { return false; }
|
|
51
|
+
}
|
|
52
|
+
export function anchorRuntimeReceipt(capture: ReceiptCapture, check: VerificationCheckInput, originDispatchId: string, serialized: string): RuntimeReceipt {
|
|
53
|
+
const bytes = evidenceBytes(capture.sessionDir, check.evidenceRef);
|
|
54
|
+
if (!bytes.equals(Buffer.from(serialized))) throw Error("Runtime receipt evidence readback mismatch");
|
|
55
|
+
return { ...capture, scope: [...capture.scope], originDispatchId, backend: "native", capturedAt: Date.now(), check: structuredClone(check), evidenceHash: hash(bytes) };
|
|
56
|
+
}
|
|
57
|
+
export function reusableRuntimeChecks(state: RuntimeReceiptState, capture: ReceiptCapture, revision: string): VerificationCheckInput[] {
|
|
58
|
+
if (state.generation !== capture.generation || state.epoch !== capture.epoch || state.pending.length !== 1 || state.pending[0] !== capture.captureId || !hex(revision)) return [];
|
|
59
|
+
return state.records.filter(r => {
|
|
60
|
+
if (r.taskId !== capture.taskId || r.sessionDir !== capture.sessionDir || r.declarationHash !== capture.declarationHash || r.epoch !== capture.epoch || JSON.stringify(r.scope) !== JSON.stringify(capture.scope) || r.check.inspectedRevision !== revision) return false;
|
|
61
|
+
try { return hash(evidenceBytes(capture.sessionDir, r.check.evidenceRef)) === r.evidenceHash; } catch { return false; }
|
|
62
|
+
}).map(r => structuredClone(r.check));
|
|
63
|
+
}
|