@chankov/agent-fleet 2.0.14 → 2.0.15
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/scripts/fleet.ts +2 -1
- package/.pi/extensions/compact-and-continue/README.md +2 -2
- package/.pi/harnesses/agent-hub/README.md +89 -10
- package/.pi/harnesses/agent-hub/budget-recovery.ts +2 -2
- package/.pi/harnesses/agent-hub/commands/context.ts +2 -0
- package/.pi/harnesses/agent-hub/commands/recover.ts +13 -4
- package/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.pi/harnesses/agent-hub/context/budgets.ts +9 -7
- package/.pi/harnesses/agent-hub/deterministic-fs.ts +51 -12
- package/.pi/harnesses/agent-hub/dispatch-native-complete.ts +4 -0
- package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +14 -3
- package/.pi/harnesses/agent-hub/dispatch-native-types.ts +3 -0
- package/.pi/harnesses/agent-hub/dispatch-native.ts +9 -1
- package/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +2 -1
- package/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +2 -0
- package/.pi/harnesses/agent-hub/dispatch-triage-state.ts +23 -5
- package/.pi/harnesses/agent-hub/docs-lane.js +2 -1
- package/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.pi/harnesses/agent-hub/filesystem-tool.ts +75 -11
- package/.pi/harnesses/agent-hub/index.ts +246 -19
- package/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +13 -5
- package/.pi/harnesses/agent-hub/no-progress.ts +232 -28
- package/.pi/harnesses/agent-hub/orchestration-activation.ts +112 -0
- package/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.pi/harnesses/agent-hub/orchestration-route.ts +76 -0
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/policy/work-mode.ts +14 -5
- package/.pi/harnesses/agent-hub/process-obligations.ts +116 -15
- package/.pi/harnesses/agent-hub/prompts/fragments.ts +9 -11
- package/.pi/harnesses/agent-hub/recover-policy.ts +18 -1
- package/.pi/harnesses/agent-hub/recover-state.ts +1 -1
- package/.pi/harnesses/agent-hub/recovery-contract.ts +70 -0
- package/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.pi/harnesses/agent-hub/research/runtime.ts +2 -0
- package/.pi/harnesses/agent-hub/research/spawn-run.ts +15 -6
- package/.pi/harnesses/agent-hub/return-contract.js +27 -5
- package/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.pi/harnesses/agent-hub/run-budget.js +12 -0
- package/.pi/harnesses/agent-hub/scope-gate.js +23 -2
- package/.pi/harnesses/agent-hub/session-audit.ts +94 -8
- package/.pi/harnesses/agent-hub/spawn.ts +10 -2
- package/.pi/harnesses/agent-hub/system1-activity.ts +116 -1
- package/.pi/harnesses/agent-hub/system1-communication-store.ts +47 -13
- package/.pi/harnesses/agent-hub/system1-report.ts +50 -0
- package/.pi/harnesses/agent-hub/system1-runtime.ts +3 -2
- package/.pi/harnesses/agent-hub/task-triage-authorization.ts +122 -0
- package/.pi/harnesses/agent-hub/task-triage-config.ts +37 -0
- package/.pi/harnesses/agent-hub/task-triage-contract.ts +19 -0
- package/.pi/harnesses/agent-hub/task-triage-obligations.ts +104 -0
- package/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.pi/harnesses/agent-hub/task-triage-runtime.ts +125 -0
- package/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +33 -10
- package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +1 -1
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +86 -26
- package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +9 -0
- package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +9 -6
- package/.pi/harnesses/agent-hub/ui/fleet-source.ts +6 -2
- package/.pi/harnesses/agent-hub/ui/system1-communication.ts +1 -1
- package/.pi/harnesses/agent-hub/work-mode.ts +13 -8
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/context-budget-hub-prompt.ts +6 -1
- package/.pi/harnesses/lib/fleet-dashboard-view.ts +29 -4
- package/.pi/harnesses/lib/fleet-read-model.ts +73 -0
- package/.pi/harnesses/lib/system1/demo.ts +2 -4
- package/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.pi/prompts/af-build.md +9 -6
- package/.versions/2.0.15/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.15/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.15/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/fleet.ts +217 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/flow.ts +157 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/flow-command.ts +98 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/package-lock.json +35 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/package.json +9 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +179 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +34 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.15/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.0.15/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.15/.pi/agents/model-profiles.yaml +134 -0
- package/.versions/2.0.15/.pi/agents/peers.yaml +147 -0
- package/.versions/2.0.15/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.15/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.15/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.15/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.15/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.15/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.15/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.15/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.15/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.15/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.15/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.15/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/2.0.15/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.15/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.15/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.15/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.15/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.15/.pi/extensions/package.json +9 -0
- package/.versions/2.0.15/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.0.15/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.15/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.15/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.15/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.15/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.15/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/README.md +1448 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/acceptance.ts +199 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/assist-profile.ts +16 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/budget-recovery.ts +214 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/context.ts +47 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/config/agents.ts +178 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/config/model-profiles.ts +236 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/config/overrides.ts +160 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/context/budgets.ts +206 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/delegate.ts +467 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/deterministic-fs.ts +166 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-coms.ts +252 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native-complete.ts +173 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +259 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +231 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native-types.ts +260 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-native.ts +234 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +38 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +76 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/filesystem-tool.ts +137 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/fixtures/registration-surface.json +64 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/helpers.ts +270 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/hub-state-audit.js +65 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/index.ts +2597 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +133 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/no-progress.ts +563 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/orchestration-activation.ts +112 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/orchestration-route.ts +76 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/policy/work-mode.ts +135 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-config.ts +40 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-local.ts +88 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-observer.ts +105 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-rules.ts +143 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-runtime.ts +316 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-snapshot.ts +243 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/proactive-types.ts +63 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/process-obligations.ts +158 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/prompts/context.ts +54 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/prompts/fragments.ts +116 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/prompts/system-prompt.ts +122 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/recovery-contract.ts +150 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/research/runtime.ts +197 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/research/spawn-run.ts +183 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/return-contract.js +349 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/review-findings.js +104 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/run-budget.js +554 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/scope-gate.js +144 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/session-audit.ts +313 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/spawn.ts +534 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/system1-communication-store.ts +129 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/system1-runtime.ts +280 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-authorization.ts +122 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-config.ts +37 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-contract.ts +19 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-live-stage-closure.user-run.mjs +336 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-obligations.ts +104 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-reviewer-only.user-run.mjs +157 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-runtime.ts +125 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +68 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/action-executors.ts +208 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/context.ts +144 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +88 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +558 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/herdr-executors.ts +95 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/run-flow.ts +136 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/spawn-research.ts +65 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/context-budget.ts +87 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +155 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/work-mode.ts +179 -0
- package/.versions/2.0.15/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
- package/.versions/2.0.15/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.0.15/.pi/harnesses/ask-user-remote/index.ts +558 -0
- package/.versions/2.0.15/.pi/harnesses/ask-user-remote/questions.ts +161 -0
- package/.versions/2.0.15/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.0.15/.pi/harnesses/ask-user-remote/runtime-ask.ts +68 -0
- package/.versions/2.0.15/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.15/.pi/harnesses/coms/index.ts +282 -0
- package/.versions/2.0.15/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.15/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.15/.pi/harnesses/damage-control-continue/README.md +135 -0
- package/.versions/2.0.15/.pi/harnesses/damage-control-continue/index.ts +550 -0
- package/.versions/2.0.15/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.15/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.15/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.0.15/.pi/harnesses/lib/coms-core-io.ts +385 -0
- package/.versions/2.0.15/.pi/harnesses/lib/coms-core.ts +577 -0
- package/.versions/2.0.15/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/2.0.15/.pi/harnesses/lib/context-budget-child-prompt.ts +219 -0
- package/.versions/2.0.15/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
- package/.versions/2.0.15/.pi/harnesses/lib/context-budget-view.ts +107 -0
- package/.versions/2.0.15/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.15/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/2.0.15/.pi/harnesses/lib/deterministic-handle-path.ts +23 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-dashboard-view.ts +172 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.0.15/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.15/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.15/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.15/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.15/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.0.15/.pi/harnesses/lib/system1/config.js +61 -0
- package/.versions/2.0.15/.pi/harnesses/lib/system1/contracts.ts +152 -0
- package/.versions/2.0.15/.pi/harnesses/lib/system1/demo.ts +104 -0
- package/.versions/2.0.15/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.0.15/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.0.15/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.0.15/.pi/harnesses/lib/update-check.ts +222 -0
- package/.versions/2.0.15/.pi/harnesses/package-lock.json +2039 -0
- package/.versions/2.0.15/.pi/harnesses/package.json +10 -0
- package/.versions/2.0.15/.pi/prompts/af-build.md +27 -0
- package/.versions/2.0.15/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.15/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.15/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.15/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.15/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.15/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.15/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.0.15/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.15/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.15/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.15/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.15/.version +1 -0
- package/.versions/2.0.15/agents/architect.md +24 -0
- package/.versions/2.0.15/agents/bowser.md +28 -0
- package/.versions/2.0.15/agents/builder.md +55 -0
- package/.versions/2.0.15/agents/code-reviewer.md +209 -0
- package/.versions/2.0.15/agents/deep-researcher.md +32 -0
- package/.versions/2.0.15/agents/documenter.md +22 -0
- package/.versions/2.0.15/agents/orchestrator.md +22 -0
- package/.versions/2.0.15/agents/plan-reviewer.md +83 -0
- package/.versions/2.0.15/agents/planner.md +105 -0
- package/.versions/2.0.15/agents/releaser.md +24 -0
- package/.versions/2.0.15/agents/researcher.md +30 -0
- package/.versions/2.0.15/agents/security-auditor.md +167 -0
- package/.versions/2.0.15/agents/test-engineer.md +153 -0
- package/.versions/2.0.15/agents/web-debugger.md +44 -0
- package/.versions/2.0.15/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.15/bin/catalog/harness-runtime-closure.json +73 -0
- package/.versions/2.0.15/codex/fleet-session-client/SKILL.md +34 -0
- package/.versions/2.0.15/codex/fleet-session-client.zip +0 -0
- package/.versions/2.0.15/docs/ARCHITECTURE.md +829 -0
- package/.versions/2.0.15/docs/agent-fleet-setup.md +1090 -0
- package/.versions/2.0.15/docs/claude-code-coms-bridge.md +134 -0
- package/.versions/2.0.15/docs/codex-session-bridge.md +219 -0
- package/.versions/2.0.15/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.0.15/docs/getting-started.md +126 -0
- package/.versions/2.0.15/docs/npm-install.md +525 -0
- package/.versions/2.0.15/docs/pi-extensions.md +454 -0
- package/.versions/2.0.15/docs/pi-setup.md +92 -0
- package/.versions/2.0.15/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.15/install-manifest.json +3193 -0
- package/.versions/2.0.15/justfile +247 -0
- package/.versions/2.0.15/manifest-meta.json +1071 -0
- package/.versions/2.0.15/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.15/references/communication-contract.md +26 -0
- package/.versions/2.0.15/references/definition-of-done.md +67 -0
- package/.versions/2.0.15/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.15/references/observability-checklist.md +92 -0
- package/.versions/2.0.15/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.15/references/performance-checklist.md +236 -0
- package/.versions/2.0.15/references/prompting-patterns.md +380 -0
- package/.versions/2.0.15/references/security-checklist.md +245 -0
- package/.versions/2.0.15/references/testing-patterns.md +235 -0
- package/.versions/2.0.15/references/workflow-authoring.md +304 -0
- package/.versions/2.0.15/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.15/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.15/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.15/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.15/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.0.15/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.15/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.0.15/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.15/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.15/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.15/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.15/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.15/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.15/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.15/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.15/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.15/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.15/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.15/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.15/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.0.15/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.15/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.0.15/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.15/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.15/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.0.15/skills/repository-ai-setup/SKILL.md +117 -0
- package/.versions/2.0.15/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.0.15/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.0.15/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.0.15/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.0.15/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.0.15/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.15/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.0.15/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.0.15/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/agents/builder.md +2 -2
- package/bin/cli.js +16 -2
- package/bin/lib/apply.js +5 -0
- package/bin/lib/doctor.js +85 -12
- package/bin/lib/reconcile.js +9 -1
- package/bin/lib/state.js +1 -0
- package/bin/lib/task-triage-setup.js +76 -0
- package/bin/lib/transaction.js +4 -0
- package/docs/ARCHITECTURE.md +99 -24
- package/docs/agent-fleet-setup.md +179 -6
- package/docs/npm-install.md +64 -15
- package/docs/pi-extensions.md +1 -1
- package/install-manifest.json +13 -3
- package/manifest-meta.json +6 -0
- package/package.json +9 -2
- package/skills/incremental-implementation/SKILL.md +64 -13
- package/skills/planning-and-task-breakdown/SKILL.md +43 -14
- package/skills/using-agent-skills/SKILL.md +2 -2
|
@@ -10,6 +10,7 @@ import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
|
10
10
|
import { contextPct, resolveContextWindow } from "../context-window.js";
|
|
11
11
|
import { isReadOnlyToolList, safePathWithin } from "../helpers.ts";
|
|
12
12
|
import { researchTerminationOutcome, researchWatchdogSpawnOptions } from "../research-watchdog.ts";
|
|
13
|
+
import { explicitProcessLifecycle, lifecycleAfterSpawnException } from "../recovery-contract.ts";
|
|
13
14
|
import type { InputArtifactPreview } from "../context/assertions-artifacts.ts";
|
|
14
15
|
import type { ResearchAgentDef, ResearchFinalizeOutcome, ResearchResult, ResearchRuntimeDeps, ResearchState } from "./runtime.ts";
|
|
15
16
|
import { bumpMessageCount } from "../ui/activity-dots.ts";
|
|
@@ -41,6 +42,8 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
|
|
|
41
42
|
const startTime = Date.now();
|
|
42
43
|
let result: ResearchResult | undefined;
|
|
43
44
|
let diagnostics: object | null = null;
|
|
45
|
+
let spawnAttempted = false;
|
|
46
|
+
let spawnLifecycle: { launched: boolean; closeSeen: boolean } | undefined;
|
|
44
47
|
const transcriptPath = safePathWithin(state.evidenceDir, "transcript.jsonl");
|
|
45
48
|
|
|
46
49
|
const settle = (status: ResearchFinalizeOutcome["status"], historyStatus: ResearchFinalizeOutcome["historyStatus"], lastWork: string, settled: ResearchResult): ResearchResult => {
|
|
@@ -56,7 +59,8 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
|
|
|
56
59
|
if (!state.histEntry) state.histEntry = deps.executionHistory.start("research", `Research r${state.id}`);
|
|
57
60
|
|
|
58
61
|
const safety = deps.requireSafetyHarness(deps.getSafetyHarnessPath());
|
|
59
|
-
|
|
62
|
+
// T3: safety refusal never launched a process — distinct from spawn failure and timeout.
|
|
63
|
+
if (!safety.ok) return settle("error", "error", safety.error, { output: safety.error, exitCode: 1, elapsed: 0, lifecycle: { launched: false, closeSeen: false } });
|
|
60
64
|
|
|
61
65
|
state.status = "running";
|
|
62
66
|
state.task = prompt;
|
|
@@ -89,6 +93,7 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
|
|
|
89
93
|
const boundedOutputDir = safePathWithin(state.evidenceDir, "bounded-output");
|
|
90
94
|
const researchTools = deterministicTools && !deps.researchTools.split(",").includes("filesystem") ? `${deps.researchTools},filesystem` : deps.researchTools;
|
|
91
95
|
const cwd = ctx.cwd || process.cwd();
|
|
96
|
+
spawnAttempted = true;
|
|
92
97
|
const res = await deps.providerSemaphore.run(state.model, () => deps.spawnPiAgentWithModelFallback({
|
|
93
98
|
model: state.model, tools: researchTools, thinking: thinkingLevel,
|
|
94
99
|
systemPrompt: deps.nativeResearchSystemPrompt({
|
|
@@ -142,29 +147,33 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
|
|
|
142
147
|
diagnostics = { assistantError: res.assistantError ?? null, stderr: res.stderr, spawnError: res.spawnError ?? null, modelUsed: res.modelUsed ?? null, toolCallsStarted: res.toolCallsStarted ?? null, termination: res.termination ?? null, processExitCode: res.exitCode };
|
|
143
148
|
state.elapsed = Date.now() - startTime;
|
|
144
149
|
state.proc = undefined;
|
|
150
|
+
// T3: only explicit spawn lifecycle is trusted. Missing facts stay omitted, not inferred.
|
|
151
|
+
spawnLifecycle = explicitProcessLifecycle((res as { lifecycle?: unknown }).lifecycle);
|
|
152
|
+
const lifecycle = spawnLifecycle;
|
|
145
153
|
if (res.spawnError) {
|
|
146
|
-
return settle("error", "error", `Error: ${res.spawnError}`, { output: `Error spawning research helper: ${res.spawnError}`, exitCode: 1, elapsed: state.elapsed });
|
|
154
|
+
return settle("error", "error", `Error: ${res.spawnError}`, { output: `Error spawning research helper: ${res.spawnError}`, exitCode: 1, elapsed: state.elapsed, lifecycle });
|
|
147
155
|
}
|
|
148
156
|
if (res.termination) {
|
|
149
157
|
const outcome = researchTerminationOutcome(state.id, res.termination);
|
|
150
|
-
return settle("error", "error", outcome.lastWork, { output: outcome.output, exitCode: outcome.exitCode, elapsed: state.elapsed, termination: res.termination });
|
|
158
|
+
return settle("error", "error", outcome.lastWork, { output: outcome.output, exitCode: outcome.exitCode, elapsed: state.elapsed, termination: res.termination, lifecycle });
|
|
151
159
|
}
|
|
152
160
|
if (state.killedByOperator) {
|
|
153
161
|
state.killedByOperator = false;
|
|
154
|
-
return settle("idle", "idle", "(killed by operator)", { output: `Research helper r${state.id} was killed by the operator before it finished.`, exitCode: res.exitCode == null || res.exitCode === 0 ? 143 : res.exitCode, elapsed: state.elapsed });
|
|
162
|
+
return settle("idle", "idle", "(killed by operator)", { output: `Research helper r${state.id} was killed by the operator before it finished.`, exitCode: res.exitCode == null || res.exitCode === 0 ? 143 : res.exitCode, elapsed: state.elapsed, lifecycle });
|
|
155
163
|
}
|
|
156
164
|
|
|
157
165
|
const status = res.exitCode === 0 ? "done" : "error";
|
|
158
166
|
const lastWork = String(res.output ?? "").split("\n").filter((line: string) => line.trim()).pop() || "";
|
|
159
167
|
const completed = completeOutput(state, res);
|
|
160
168
|
const parent = res.boundedOutput ? boundOutput({ content: completed, retentionDir: safePathWithin(state.evidenceDir, "bounded-output", "parent"), label: "parent-summary" }) : null;
|
|
161
|
-
const settled = settle(status, status, lastWork, { output: parent?.reply ?? completed, exitCode: res.exitCode ?? 1, elapsed: state.elapsed });
|
|
169
|
+
const settled = settle(status, status, lastWork, { output: parent?.reply ?? completed, exitCode: res.exitCode ?? 1, elapsed: state.elapsed, lifecycle });
|
|
162
170
|
ctx.ui.notify(`Research r${state.id} ${status} in ${Math.round(state.elapsed / 1000)}s`, status === "done" ? "info" : "error");
|
|
163
171
|
return settled;
|
|
164
172
|
} catch (err: unknown) {
|
|
165
173
|
const message = err instanceof Error ? err.message : String(err);
|
|
166
174
|
state.elapsed = Date.now() - startTime;
|
|
167
|
-
|
|
175
|
+
const lifecycle = lifecycleAfterSpawnException({ spawnAttempted, spawnLifecycle, processSeen: !!state.proc });
|
|
176
|
+
return settle("error", "error", `Error: ${message}`, { output: `Error spawning research helper: ${message}`, exitCode: 1, elapsed: state.elapsed, ...(lifecycle ? { lifecycle } : {}) });
|
|
168
177
|
} finally {
|
|
169
178
|
if (!result) {
|
|
170
179
|
state.elapsed = Date.now() - startTime;
|
|
@@ -149,8 +149,8 @@ function parseCandidate(text) {
|
|
|
149
149
|
let score = 0;
|
|
150
150
|
|
|
151
151
|
const keyBlocks = collectKeyBlocks(text);
|
|
152
|
-
for (const [key,
|
|
153
|
-
result[key] = parseEntries(key, block);
|
|
152
|
+
for (const [key, blocks] of keyBlocks) {
|
|
153
|
+
result[key] = blocks.flatMap((block) => parseEntries(key, block));
|
|
154
154
|
score += 2 + result[key].length;
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -189,7 +189,7 @@ function collectKeyBlocks(text) {
|
|
|
189
189
|
const found = new Map();
|
|
190
190
|
const lines = text.split(/\r?\n/);
|
|
191
191
|
for (let i = 0; i < lines.length; i++) {
|
|
192
|
-
const match = lines[i].match(/^\s*([A-Za-z][A-Za-z0-9_ -]*)
|
|
192
|
+
const match = lines[i].match(/^\s*["']?([A-Za-z][A-Za-z0-9_ -]*)["']?\s*:\s*(.*)$/);
|
|
193
193
|
if (!match) continue;
|
|
194
194
|
const key = normalizeKey(match[1]);
|
|
195
195
|
if (!STRUCTURED_KEYS.includes(key)) continue;
|
|
@@ -199,15 +199,21 @@ function collectKeyBlocks(text) {
|
|
|
199
199
|
let j = i + 1;
|
|
200
200
|
for (; j < lines.length; j++) {
|
|
201
201
|
const next = lines[j];
|
|
202
|
-
const nextKey = next.match(/^\s*([A-Za-z][A-Za-z0-9_ -]*)
|
|
202
|
+
const nextKey = next.match(/^\s*["']?([A-Za-z][A-Za-z0-9_ -]*)["']?\s*:\s*/);
|
|
203
203
|
const isKnownNextKey = nextKey && STRUCTURED_KEYS.includes(normalizeKey(nextKey[1]));
|
|
204
204
|
const isHeading = /^\s*#{1,6}\s+/.test(next);
|
|
205
|
+
// Fences delimit a structured candidate, never a value. In the
|
|
206
|
+
// whole-response candidate a closing fence used to become the last
|
|
207
|
+
// decision entry (e.g. "[]\n```").
|
|
208
|
+
if (/^\s*```/.test(next) || (bracketBalance <= 0 && /^\s*}[,;]?\s*$/.test(next))) break;
|
|
205
209
|
if (bracketBalance <= 0 && (isKnownNextKey || isHeading)) break;
|
|
206
210
|
if (next.trim() === "" && bracketBalance <= 0) break;
|
|
207
211
|
block.push(next);
|
|
208
212
|
bracketBalance += balanceBrackets(next);
|
|
209
213
|
}
|
|
210
|
-
|
|
214
|
+
// Repeated blocks (including distinct fences) must not hide a real
|
|
215
|
+
// decision behind a later empty declaration.
|
|
216
|
+
found.set(key, [...(found.get(key) || []), block.join("\n")]);
|
|
211
217
|
}
|
|
212
218
|
return found;
|
|
213
219
|
}
|
|
@@ -251,6 +257,22 @@ function collectLineFormAssertions(text) {
|
|
|
251
257
|
}
|
|
252
258
|
|
|
253
259
|
function parseEntries(key, rawBlock) {
|
|
260
|
+
if (key === "requires_user_decision") {
|
|
261
|
+
const [first, ...rest] = rawBlock.split(/\r?\n/);
|
|
262
|
+
// A completed inline list cannot consume following prose as a single
|
|
263
|
+
// array value. Retain that prose as an additional decision rather than
|
|
264
|
+
// silently discarding ambiguous or malformed content.
|
|
265
|
+
if (rest.length && /^\[.*\],?$/.test(first.trim())) {
|
|
266
|
+
return [...parseEntries(key, first), ...splitListEntries(rest.join("\n"))];
|
|
267
|
+
}
|
|
268
|
+
const value = rawBlock.trim().replace(/,\s*$/, "");
|
|
269
|
+
if (/^\[.*\]$/s.test(value)) {
|
|
270
|
+
try {
|
|
271
|
+
const entries = JSON.parse(value);
|
|
272
|
+
if (Array.isArray(entries) && entries.every((entry) => typeof entry === "string")) return entries;
|
|
273
|
+
} catch { /* YAML and malformed list content remain visible to the caller. */ }
|
|
274
|
+
}
|
|
275
|
+
}
|
|
254
276
|
if (ASSERTION_KEYS.has(key)) {
|
|
255
277
|
return splitAssertionEntries(rawBlock).map(parseAssertionEntry).filter(Boolean);
|
|
256
278
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ReviewClosureInput {
|
|
2
|
+
revision: string;
|
|
3
|
+
scope: string[];
|
|
4
|
+
prose?: string;
|
|
5
|
+
origin?: "declared" | "extracted" | "missing";
|
|
6
|
+
structuredReturn?: { verdict?: string; evidenceRefs?: string[] };
|
|
7
|
+
evidenceComplete?: boolean;
|
|
8
|
+
evidenceRevision?: string;
|
|
9
|
+
changedAfterReview?: string[];
|
|
10
|
+
status?: "closed" | "unproven" | "invalidated";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ReviewClosure {
|
|
14
|
+
status: "closed" | "unproven" | "invalidated";
|
|
15
|
+
revision: string;
|
|
16
|
+
scope: string[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function closeReview(input: ReviewClosureInput): ReviewClosure {
|
|
20
|
+
const scope = [...input.scope];
|
|
21
|
+
if (input.changedAfterReview?.some(path => scope.includes(path))) {
|
|
22
|
+
return { status: "invalidated", revision: input.revision, scope };
|
|
23
|
+
}
|
|
24
|
+
const refs = input.structuredReturn?.evidenceRefs ?? [];
|
|
25
|
+
const declared = input.origin === "declared" && input.structuredReturn?.verdict === "PASS" && refs.length > 0;
|
|
26
|
+
const extracted = input.origin === "extracted" && input.structuredReturn?.verdict === "PASS" && input.evidenceComplete === true && input.evidenceRevision === input.revision && refs.length > 0;
|
|
27
|
+
return { status: declared || extracted ? "closed" : "unproven", revision: input.revision, scope };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function updateAssertion(input: {
|
|
31
|
+
id: string;
|
|
32
|
+
evidenceRef: string;
|
|
33
|
+
evidenceRevision: string;
|
|
34
|
+
currentRevision: string;
|
|
35
|
+
changedPaths: string[];
|
|
36
|
+
assertionPaths: string[];
|
|
37
|
+
}): { accepted: boolean; reason: string } {
|
|
38
|
+
if (!input.evidenceRef.trim()) return { accepted: false, reason: "named evidence is required" };
|
|
39
|
+
if (input.evidenceRevision !== input.currentRevision) return { accepted: false, reason: "evidence revision is stale" };
|
|
40
|
+
const touched = input.changedPaths.some(path => input.assertionPaths.includes(path));
|
|
41
|
+
if (touched) return { accepted: false, reason: "reviewed assertion path changed" };
|
|
42
|
+
return { accepted: true, reason: "unrelated assertion remains valid" };
|
|
43
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -106,6 +106,18 @@ export function resolveTurnBudget(tier, overrides = {}) {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/** Orchestrator needs one implementation, one review, and one correction in a turn.
|
|
110
|
+
* This raises only the turn dispatch cap. A configured max-dispatches-per-turn
|
|
111
|
+
* ceiling still wins, and the task envelope stays on the unfloored tier budget. */
|
|
112
|
+
export const ORCHESTRATOR_TURN_DISPATCH_FLOOR = 3;
|
|
113
|
+
|
|
114
|
+
export function orchestratorTurnBudget(turnBudget, workMode, explicitDispatchCeiling) {
|
|
115
|
+
if (workMode !== "orchestrator" || !turnBudget || turnBudget.maxDispatches == null) return turnBudget;
|
|
116
|
+
if (typeof explicitDispatchCeiling === "number") return turnBudget;
|
|
117
|
+
if (turnBudget.maxDispatches >= ORCHESTRATOR_TURN_DISPATCH_FLOOR) return turnBudget;
|
|
118
|
+
return { ...turnBudget, maxDispatches: ORCHESTRATOR_TURN_DISPATCH_FLOOR };
|
|
119
|
+
}
|
|
120
|
+
|
|
109
121
|
function refusalTail(tier) {
|
|
110
122
|
const label = normalizeTaskTier(tier) ?? DEFAULT_TASK_TIER;
|
|
111
123
|
return "Do NOT retry this call before human confirmation. Summarize progress so far (including " +
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { lstatSync, readFileSync, readlinkSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
4
|
+
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
5
5
|
|
|
6
6
|
export function snapshotWorktree(cwd) {
|
|
7
7
|
const status = gitStatus(cwd);
|
|
@@ -36,11 +36,32 @@ export function diffAgainst(snapshot, cwd) {
|
|
|
36
36
|
} catch (error) { return { skipped: true, reason: String(error), paths: [] }; }
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const isSessionOutput = path => path.startsWith(".pi/agent-sessions/");
|
|
40
|
+
|
|
41
|
+
/** Review task edits, not outputs created inside this run's own session directory.
|
|
42
|
+
* A declared scope/deliverable under that directory is still a task edit to review.
|
|
43
|
+
* Other sessions' files and all non-session paths remain reviewable.
|
|
44
|
+
*/
|
|
45
|
+
export function reviewableChangedPaths(paths, cwd, sessionDir, scopes = [], deliverables = []) {
|
|
46
|
+
const sessionPath = relative(resolve(cwd), resolve(sessionDir)).replace(/\\/g, "/");
|
|
47
|
+
const ownedSession = /^\.pi\/agent-sessions\/sessions\/[^/]+$/.test(sessionPath) && !isAbsolute(sessionPath);
|
|
48
|
+
// A generic glob (for example **/*.md) does not explicitly select runtime evidence.
|
|
49
|
+
const explicitSessionScopes = scopes.filter(scope => {
|
|
50
|
+
const normalized = normalizePath(scope);
|
|
51
|
+
return normalized === sessionPath || normalized.startsWith(`${sessionPath}/`);
|
|
52
|
+
});
|
|
53
|
+
return paths.filter(path => {
|
|
54
|
+
const output = path.startsWith(`${sessionPath}/`) ? path.slice(sessionPath.length + 1) : "";
|
|
55
|
+
if (!ownedSession || !/^(?:artifacts|dispatches|transcripts|findings|delegations)\/|^(?:session|assertions)\.json$/.test(output)) return true;
|
|
56
|
+
return checkScope([path], explicitSessionScopes).inScope.length > 0 || deliverables.some(file => relative(resolve(cwd), resolve(file)) === path);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
39
60
|
/** Runtime outputs are not input progress. Callers add explicitly supplied evidence separately. */
|
|
40
61
|
export function worktreeRevision(cwd, scopes = []) {
|
|
41
62
|
const snapshot = snapshotWorktree(cwd);
|
|
42
63
|
if (snapshot.skipped) return "unavailable";
|
|
43
|
-
const entries = [...snapshot.fingerprints].filter(([path]) => !path
|
|
64
|
+
const entries = [...snapshot.fingerprints].filter(([path]) => !isSessionOutput(path) && (!scopes.length || checkScope([path], scopes).inScope.length)).sort(([a], [b]) => a.localeCompare(b));
|
|
44
65
|
return createHash("sha256").update(JSON.stringify([snapshot.head, entries])).digest("hex");
|
|
45
66
|
}
|
|
46
67
|
|
|
@@ -3,9 +3,13 @@ import { basename, join } from "node:path";
|
|
|
3
3
|
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
4
4
|
import { redactSecrets } from "../lib/fleet-transcript-store.ts";
|
|
5
5
|
import { RECOVERY_CATEGORIES, type RecoveryCategory } from "./recovery-contract.ts";
|
|
6
|
-
import { readWatchdogEvents, buildProactiveReport, readProactiveReport, type ProactiveReportInput } from "./system1-report.ts";
|
|
7
|
-
import {
|
|
6
|
+
import { readWatchdogEvents, buildProactiveReport, readProactiveReport, readTaskTriageReport, buildTaskTriageReport, type ProactiveReportInput } from "./system1-report.ts";
|
|
7
|
+
import { projectTaskTriage, type TaskTriageProjectionInput, type TaskTriageSessionView } from "../lib/fleet-read-model.ts";
|
|
8
|
+
import { projectWatchdogReadback, type TaskTriageActivity } from "./system1-activity.ts";
|
|
9
|
+
export type TaskTriageAuditInput = Omit<TaskTriageProjectionInput, "process"> & { activity?: ReturnType<TaskTriageActivity["live"]> };
|
|
8
10
|
import { createNoProgressGuard, projectRecoveryRows } from './no-progress.ts';
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
12
|
+
import { taskTriageActionAuditRecord, type TaskTriageActionAuditRecord } from "./task-triage-authorization.ts";
|
|
9
13
|
|
|
10
14
|
const RESULT_SCHEMA = "agent-fleet.runtime-result/v1";
|
|
11
15
|
const PROTOCOL_SCHEMA = "agent-fleet.tool-protocol-diagnostic/v1";
|
|
@@ -33,7 +37,8 @@ export interface SessionAuditEvent {
|
|
|
33
37
|
risk?: "unknown" | "low" | "high";
|
|
34
38
|
scope?: "unknown" | "read-only" | "small" | "wide";
|
|
35
39
|
budgetTier?: string | null;
|
|
36
|
-
obligations?: Record<string, "satisfied" | "open" | "unsupported">;
|
|
40
|
+
obligations?: Record<string, "satisfied" | "open" | "unsupported" | "waived">;
|
|
41
|
+
processAdditions?: TaskTriageSessionView["process"]["additions"];
|
|
37
42
|
appliedRuleIds?: string[];
|
|
38
43
|
currentStage?: string;
|
|
39
44
|
admissibleNextAction?: string;
|
|
@@ -52,6 +57,7 @@ export interface SessionAuditSummary {
|
|
|
52
57
|
};
|
|
53
58
|
events: SessionAuditEvent[];
|
|
54
59
|
proactive: ReturnType<typeof buildProactiveReport> | ReturnType<typeof readProactiveReport>;
|
|
60
|
+
taskTriage: TaskTriageSessionView & { metrics: ReturnType<typeof readTaskTriageReport>; actions: ReturnType<typeof projectTaskTriageActions> };
|
|
55
61
|
unavailable: string[];
|
|
56
62
|
}
|
|
57
63
|
|
|
@@ -76,8 +82,66 @@ function runtimeResult(details: Record<string, any> | null): Record<string, any>
|
|
|
76
82
|
return value?.schema === RESULT_SCHEMA ? value : null;
|
|
77
83
|
}
|
|
78
84
|
|
|
85
|
+
/** Diagnostic joins only: durable consumption is not proof of execution or semantic acceptance. */
|
|
86
|
+
export function projectTaskTriageActions(entries: readonly unknown[], binding?: Pick<TaskTriageProjectionInput, "taskId" | "inputRevision">) {
|
|
87
|
+
type ActionRow = { metadata: TaskTriageActionAuditRecord; requested: boolean; denied: boolean; grant: boolean; consumed: boolean;
|
|
88
|
+
consumptionFailed: boolean; execution: "not_recorded" | "tool_result_ok" | "tool_result_error"; ambiguous: boolean; seen: Set<string> };
|
|
89
|
+
const rows = new Map<string, ActionRow>();
|
|
90
|
+
let invalidRecords = 0, overflow = false;
|
|
91
|
+
const hash = (v: unknown): v is string => typeof v === "string" && /^[a-f0-9]{64}$/.test(v);
|
|
92
|
+
const uuid = (v: unknown): v is string => typeof v === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(v);
|
|
93
|
+
for (const entry of entries) {
|
|
94
|
+
const record = entryData(entry);
|
|
95
|
+
const observation = record.type === "agent-hub-task-triage-action-observation";
|
|
96
|
+
const grant = record.type === "agent-hub-task-triage-action-grant", consumed = record.type === "agent-hub-task-triage-action-consumed";
|
|
97
|
+
if (observation || grant || consumed) {
|
|
98
|
+
const data = record.data;
|
|
99
|
+
let metadata: TaskTriageActionAuditRecord | null = null;
|
|
100
|
+
if (observation && data?.schema === "task-triage-action-audit/v1" && uuid(data.taskId) && hash(data.inputRevision)
|
|
101
|
+
&& hash(data.actionFingerprint) && hash(data.callFingerprint) && ["bash", "edit", "write"].includes(data.operation)
|
|
102
|
+
&& ["requested", "not_granted", "consumption_failed"].includes(data.status)
|
|
103
|
+
&& Object.keys(data).length === 7) metadata = { schema: data.schema, taskId: data.taskId, inputRevision: data.inputRevision,
|
|
104
|
+
actionFingerprint: data.actionFingerprint, callFingerprint: data.callFingerprint, operation: data.operation, status: data.status };
|
|
105
|
+
else if (!observation && data) metadata = taskTriageActionAuditRecord(data as any, "requested");
|
|
106
|
+
if (!metadata) { invalidRecords++; continue; }
|
|
107
|
+
const key = JSON.stringify([metadata.taskId, metadata.inputRevision, metadata.callFingerprint]);
|
|
108
|
+
let row = rows.get(key);
|
|
109
|
+
if (!row) {
|
|
110
|
+
if (rows.size >= 300) { overflow = true; continue; }
|
|
111
|
+
row = { metadata, requested: false, denied: false, grant: false, consumed: false, consumptionFailed: false, execution: "not_recorded", ambiguous: false, seen: new Set() };
|
|
112
|
+
rows.set(key, row);
|
|
113
|
+
}
|
|
114
|
+
const type = grant ? "grant" : consumed ? "consumed" : metadata.status;
|
|
115
|
+
if (row.seen.has(type) || row.metadata.actionFingerprint !== metadata.actionFingerprint || row.metadata.operation !== metadata.operation) row.ambiguous = true;
|
|
116
|
+
row.seen.add(type);
|
|
117
|
+
if (grant) { if (row.denied || row.consumed) row.ambiguous = true; row.grant = true; }
|
|
118
|
+
else if (consumed) { if (!row.grant || row.denied || row.consumptionFailed) row.ambiguous = true; row.consumed = true; }
|
|
119
|
+
else if (metadata.status === "requested") row.requested = true;
|
|
120
|
+
else if (metadata.status === "not_granted") { if (row.grant || row.consumed) row.ambiguous = true; row.denied = true; }
|
|
121
|
+
else { if (row.consumed || !row.grant) row.ambiguous = true; row.consumptionFailed = true; }
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const message = object(object(entry)?.message);
|
|
125
|
+
if (message?.role !== "toolResult" || typeof message.toolCallId !== "string" || !message.toolCallId || message.toolCallId.length > 512) continue;
|
|
126
|
+
const call = createHash("sha256").update(message.toolCallId).digest("hex");
|
|
127
|
+
const matching = [...rows.values()].filter(row => row.metadata.callFingerprint === call && row.metadata.operation === message.toolName && row.consumed);
|
|
128
|
+
if (matching.length > 1) { matching.forEach(row => { row.ambiguous = true; }); continue; }
|
|
129
|
+
const row = matching[0]; if (!row) continue;
|
|
130
|
+
if (row.execution !== "not_recorded") row.ambiguous = true;
|
|
131
|
+
if (typeof message.isError === "boolean") row.execution = message.isError ? "tool_result_error" : "tool_result_ok";
|
|
132
|
+
}
|
|
133
|
+
const records = [...rows.values()].map(row => ({ taskId: row.metadata.taskId, inputRevision: row.metadata.inputRevision,
|
|
134
|
+
actionFingerprint: row.metadata.actionFingerprint, operation: row.metadata.operation,
|
|
135
|
+
binding: !binding?.taskId || !binding?.inputRevision ? "unbound" : row.metadata.taskId === binding.taskId && row.metadata.inputRevision === binding.inputRevision ? "current" : "stale",
|
|
136
|
+
authorization: row.ambiguous ? "ambiguous" : row.grant ? "recorded_grant" : row.denied ? "not_granted" : "not_recorded",
|
|
137
|
+
consumption: row.ambiguous ? "ambiguous" : row.consumptionFailed ? "persistence_failed" : row.consumed ? "recorded_once" : "not_recorded",
|
|
138
|
+
execution: row.ambiguous ? "not_recorded" : row.denied || row.consumptionFailed ? "blocked" : row.execution }));
|
|
139
|
+
return { availability: records.length ? "recorded" : "unavailable", records, invalidRecords, overflow,
|
|
140
|
+
ambiguous: records.filter(row => row.authorization === "ambiguous").length, completeness: "retained session entries only; no replay authority" };
|
|
141
|
+
}
|
|
142
|
+
|
|
79
143
|
/** Build an allowlisted audit from runtime-owned records. Prompt, output, payload, paths and environment values are never copied. */
|
|
80
|
-
export function buildSessionAudit(input: { entries: readonly unknown[]; sessionDir: string; proactive?: ProactiveReportInput }): SessionAuditSummary {
|
|
144
|
+
export function buildSessionAudit(input: { entries: readonly unknown[]; sessionDir: string; proactive?: ProactiveReportInput; taskTriage?: TaskTriageAuditInput }): SessionAuditSummary {
|
|
81
145
|
const unavailable = new Set<string>(), meta = readJson(join(input.sessionDir, "session.json"));
|
|
82
146
|
const rootSessionId = runtimeId(meta?.sessionId) ?? runtimeId(basename(input.sessionDir));
|
|
83
147
|
if (!meta) unavailable.add("root_session_metadata");
|
|
@@ -131,10 +195,22 @@ export function buildSessionAudit(input: { entries: readonly unknown[]; sessionD
|
|
|
131
195
|
evidence: type === 'technical' || type === 'settled' ? 'available' : 'available',
|
|
132
196
|
explanation: type === 'grant' ? 'Human-authorized one-use indeterminate retry; partial side effects and duplicate effects were warned; no automatic execution.' : type === 'technical' ? 'Technical assessment only; failed execution and parent acceptance remain independent.' : undefined });
|
|
133
197
|
}
|
|
198
|
+
let latestProcess: unknown;
|
|
134
199
|
for (const entry of input.entries) {
|
|
135
200
|
const record = entryData(entry), snapshotId = record.type === "compaction" || record.type === "session_compact" ? record.id : null;
|
|
136
201
|
if (snapshotId) { snapshots.add(snapshotId); continue; }
|
|
137
202
|
if (record.type === "agent-hub-process-state") {
|
|
203
|
+
latestProcess = record.data;
|
|
204
|
+
if (record.data && Object.hasOwn(record.data, "additions")) {
|
|
205
|
+
const projected = projectTaskTriage({ ...input.taskTriage, process: record.data }).process;
|
|
206
|
+
add({ kind: "process_obligation", rootSessionId, childDispatchId: null, childSessionId: null, snapshotId: null,
|
|
207
|
+
status: projected.completion === "process_complete" ? "accepted" : "not_accepted",
|
|
208
|
+
risk: projected.declaration.risk as SessionAuditEvent["risk"], scope: projected.declaration.scope as SessionAuditEvent["scope"],
|
|
209
|
+
budgetTier: projected.declaration.budgetTier, obligations: projected.obligations ?? undefined, processAdditions: projected.additions,
|
|
210
|
+
currentStage: projected.currentStage, evidence: projected.availability === "available" ? "available" : "unavailable",
|
|
211
|
+
explanation: "Process status only; waivers remain waived and per-effect confirmation is independent of task acceptance." });
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
138
214
|
const data = record.data, risk = ["unknown", "low", "high"].includes(data?.risk) ? data!.risk as "unknown" | "low" | "high" : "unknown";
|
|
139
215
|
const budgetTier = ["trivial", "small", "feature", "project"].includes(data?.budgetTier) ? data!.budgetTier : null;
|
|
140
216
|
const scope = ["unknown", "read-only", "small", "wide"].includes(data?.scope) ? data!.scope : "unknown";
|
|
@@ -206,9 +282,19 @@ export function buildSessionAudit(input: { entries: readonly unknown[]; sessionD
|
|
|
206
282
|
},
|
|
207
283
|
evidence: check.evaluation === "interrupted" || check.llm === "interrupted" ? "unavailable" : "available" });
|
|
208
284
|
}
|
|
285
|
+
const diskMetrics = readTaskTriageReport(input.sessionDir);
|
|
286
|
+
// Disk includes prior session instances. Use bounded live fallback only if this
|
|
287
|
+
// observer lost writes; report the source rather than duplicating its events.
|
|
288
|
+
const liveActivity = input.taskTriage?.activity;
|
|
289
|
+
const metrics = liveActivity?.degraded ? { ...buildTaskTriageReport(liveActivity.events, liveActivity, diskMetrics.observability),
|
|
290
|
+
availability: "session-memory", scope: "bounded-live-observer; durable trace degraded" } : diskMetrics;
|
|
291
|
+
const taskTriage = { ...projectTaskTriage({ ...input.taskTriage, process: latestProcess }), metrics, actions: projectTaskTriageActions(input.entries, input.taskTriage) };
|
|
292
|
+
if (taskTriage.actions.invalidRecords || taskTriage.actions.ambiguous || taskTriage.actions.overflow) unavailable.add("task_triage_action_integrity");
|
|
293
|
+
if (latestProcess !== undefined && taskTriage.process.availability === "unavailable") unavailable.add("task_triage_process_integrity");
|
|
294
|
+
if (taskTriage.metrics.observability.degraded) unavailable.add("task_triage_trace_integrity");
|
|
209
295
|
const deduped = new Map<string, SessionAuditEvent>();
|
|
210
296
|
for (const event of rawEvents) {
|
|
211
|
-
const key = JSON.stringify([event.kind, event.rootSessionId, event.childDispatchId, event.childSessionId, event.snapshotId, event.category ?? null, event.status, event.taskId ?? null, event.requestId ?? null, event.operation ?? null, event.risk ?? null, event.scope ?? null, event.budgetTier ?? null, event.obligations ?? null, event.appliedRuleIds ?? null, event.currentStage ?? null, event.admissibleNextAction ?? null, event.auditScope ?? null, event.watchdog ?? null, event.operationId ?? null, event.attemptId ?? null, event.technicalBlock ?? null, event.openRequirements ?? null]);
|
|
297
|
+
const key = JSON.stringify([event.kind, event.rootSessionId, event.childDispatchId, event.childSessionId, event.snapshotId, event.category ?? null, event.status, event.taskId ?? null, event.requestId ?? null, event.operation ?? null, event.risk ?? null, event.scope ?? null, event.budgetTier ?? null, event.obligations ?? null, event.processAdditions ?? null, event.appliedRuleIds ?? null, event.currentStage ?? null, event.admissibleNextAction ?? null, event.auditScope ?? null, event.watchdog ?? null, event.operationId ?? null, event.attemptId ?? null, event.technicalBlock ?? null, event.openRequirements ?? null]);
|
|
212
298
|
const prior = deduped.get(key);
|
|
213
299
|
if (prior) prior.repeatCount++;
|
|
214
300
|
else deduped.set(key, { ...event, repeatCount: 1 });
|
|
@@ -216,12 +302,12 @@ export function buildSessionAudit(input: { entries: readonly unknown[]; sessionD
|
|
|
216
302
|
return {
|
|
217
303
|
schema: "agent-fleet.session-audit/v1", readOnly: true,
|
|
218
304
|
identity: { rootSessionId, children: [...children].map(([dispatchId, sessionId]) => ({ dispatchId, sessionId })), snapshots: [...snapshots].map(snapshotId => ({ snapshotId })) },
|
|
219
|
-
events: [...deduped.values()], proactive: input.proactive ? buildProactiveReport(input.proactive) : readProactiveReport(input.sessionDir), unavailable: [...unavailable].sort(),
|
|
305
|
+
events: [...deduped.values()], proactive: input.proactive ? buildProactiveReport(input.proactive) : readProactiveReport(input.sessionDir), taskTriage, unavailable: [...unavailable].sort(),
|
|
220
306
|
};
|
|
221
307
|
}
|
|
222
308
|
|
|
223
309
|
export function formatSessionAudit(summary: SessionAuditSummary): string { return JSON.stringify(summary, null, 2); }
|
|
224
310
|
|
|
225
|
-
export async function showSessionAudit(ctx: ExtensionContext, sessionDir: string, proactive?: ProactiveReportInput): Promise<void> {
|
|
226
|
-
ctx.ui.notify(formatSessionAudit(buildSessionAudit({ entries: ctx.sessionManager.getEntries(), sessionDir, proactive })), "info");
|
|
311
|
+
export async function showSessionAudit(ctx: ExtensionContext, sessionDir: string, proactive?: ProactiveReportInput, taskTriage?: TaskTriageAuditInput): Promise<void> {
|
|
312
|
+
ctx.ui.notify(formatSessionAudit(buildSessionAudit({ entries: ctx.sessionManager.getEntries(), sessionDir, proactive, taskTriage })), "info");
|
|
227
313
|
}
|
|
@@ -131,6 +131,9 @@ export interface SpawnPiAgentResult {
|
|
|
131
131
|
modelFallback?: ModelFallbackNotice;
|
|
132
132
|
/** Present only when parent-side bounded termination was requested. */
|
|
133
133
|
termination?: Termination;
|
|
134
|
+
/** T3 runtime lifecycle facts: launched/close/termination are separate dimensions.
|
|
135
|
+
* Safety refusal and spawn failure never launched; timeout without close stays uncertain. */
|
|
136
|
+
lifecycle: { launched: boolean; closeSeen: boolean };
|
|
134
137
|
boundedOutput?: { truncated: boolean; totalBytes: number; handle: string; contentPath: string; sha256: string };
|
|
135
138
|
writeIsolation?: Pick<WriteIsolationResult, "applied" | "failClosed" | "mechanism" | "permissionExpansion" | "rollsBackUserEdits" | "protectsConcurrentUserWrites">;
|
|
136
139
|
}
|
|
@@ -201,7 +204,7 @@ export function spawnPiAgent(opts: SpawnPiAgentOptions, cbs: SpawnPiAgentCallbac
|
|
|
201
204
|
if(active) opts={...opts,env:{...opts.env,[PROFILE_ENV]:JSON.stringify(active)}};
|
|
202
205
|
return await spawnPiAgentUnchecked(opts,cbs);
|
|
203
206
|
} catch(error) {
|
|
204
|
-
return {output:'',stderr:String(error),exitCode:1,spawnError:String(error),modelUsed:opts.model,toolCallsStarted:0};
|
|
207
|
+
return {output:'',stderr:String(error),exitCode:1,spawnError:String(error),modelUsed:opts.model,toolCallsStarted:0,lifecycle:{launched:false,closeSeen:false}};
|
|
205
208
|
}
|
|
206
209
|
});
|
|
207
210
|
}
|
|
@@ -236,6 +239,7 @@ function spawnPiAgentUnchecked(
|
|
|
236
239
|
return Promise.resolve({
|
|
237
240
|
output: "", stderr: "", exitCode: null, modelUsed: opts.model, toolCallsStarted: 0,
|
|
238
241
|
termination: { reason: "cancelled", confirmed: false, escalated: false },
|
|
242
|
+
lifecycle: { launched: false, closeSeen: false },
|
|
239
243
|
});
|
|
240
244
|
}
|
|
241
245
|
const childEnv = nativeChildEnv(process.env, opts.env);
|
|
@@ -247,6 +251,7 @@ function spawnPiAgentUnchecked(
|
|
|
247
251
|
output: "", stderr: isolation.reason ?? "write isolation unavailable", exitCode: 1,
|
|
248
252
|
spawnError: isolation.reason ?? "write isolation unavailable; unsandboxed execution refused",
|
|
249
253
|
modelUsed: opts.model, toolCallsStarted: 0, writeIsolation: publishedIsolation,
|
|
254
|
+
lifecycle: { launched: false, closeSeen: false },
|
|
250
255
|
});
|
|
251
256
|
}
|
|
252
257
|
const launchCommand = isolation?.command ?? "pi";
|
|
@@ -324,6 +329,9 @@ function spawnPiAgentUnchecked(
|
|
|
324
329
|
stderr: stderrChunks.join(""),
|
|
325
330
|
toolCallsStarted, runtimeTests, toolEvents,
|
|
326
331
|
modelUsed: opts.model,
|
|
332
|
+
// T3: explicit lifecycle facts travel with every settlement.
|
|
333
|
+
// Missing close or an unconfirmed process tree stays uncertain downstream.
|
|
334
|
+
lifecycle: { launched: true, closeSeen },
|
|
327
335
|
...(spawnError ? { spawnError } : {}),
|
|
328
336
|
...(assistantError ? { assistantError } : {}),
|
|
329
337
|
...(termination ? { termination } : {}),
|
|
@@ -497,7 +505,7 @@ export async function spawnPiAgentWithModelFallback(
|
|
|
497
505
|
fallbackOptions: ModelFallbackOptions = {},
|
|
498
506
|
): Promise<SpawnPiAgentResult> {
|
|
499
507
|
try { fallbackModel=profileFallback(fallbackModel,readActiveProfile()??readActiveProfile(opts.env)); }
|
|
500
|
-
catch(error) { return {output:'',stderr:String(error),exitCode:1,spawnError:String(error),modelUsed:opts.model,toolCallsStarted:0}; }
|
|
508
|
+
catch(error) { return {output:'',stderr:String(error),exitCode:1,spawnError:String(error),modelUsed:opts.model,toolCallsStarted:0,lifecycle:{launched:false,closeSeen:false}}; }
|
|
501
509
|
if (!fallbackModel || fallbackModel === opts.model) return spawnPiAgent(opts, cbs);
|
|
502
510
|
|
|
503
511
|
const sessionExisted = existsSync(opts.sessionFile);
|