@selesai/code 0.9.11 → 0.9.12
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/CHANGELOG.md +11 -0
- package/dist/config.d.ts +4 -6
- package/dist/config.js +10 -14
- package/dist/core/agent-session.d.ts +0 -1
- package/dist/core/agent-session.js +3 -49
- package/dist/core/extensions/types.d.ts +0 -2
- package/dist/core/settings-manager.d.ts +0 -2
- package/dist/core/settings-manager.js +0 -3
- package/dist/core/tools/index.d.ts +0 -1
- package/dist/core/tools/index.js +0 -1
- package/dist/defaults/settings.json +0 -1
- package/dist/extensions/model-prompt-injector/index.test.ts +0 -10
- package/dist/extensions/model-prompt-injector/index.ts +0 -3
- package/dist/extensions/pi-intercom/CHANGELOG.md +53 -16
- package/dist/extensions/pi-intercom/README.md +41 -8
- package/dist/extensions/pi-intercom/banner.png +0 -0
- package/dist/extensions/pi-intercom/broker/broker.ts +498 -215
- package/dist/extensions/pi-intercom/broker/client.ts +39 -12
- package/dist/extensions/pi-intercom/broker/extension.test.ts +102 -3
- package/dist/extensions/pi-intercom/broker/paths.test.ts +2 -2
- package/dist/extensions/pi-intercom/broker/protocol.ts +26 -0
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +5 -20
- package/dist/extensions/pi-intercom/config.test.ts +41 -0
- package/dist/extensions/pi-intercom/config.ts +21 -0
- package/dist/extensions/pi-intercom/extension-api.ts +40 -0
- package/dist/extensions/pi-intercom/index.ts +362 -26
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +819 -13
- package/dist/extensions/pi-intercom/package.json +1 -1
- package/dist/extensions/pi-intercom/project-agent.ts +2 -2
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +8 -110
- package/dist/extensions/pi-intercom/types.ts +32 -5
- package/dist/extensions/pi-intercom/ui/inline-message.ts +6 -0
- package/dist/extensions/pi-subagents/.github/assets/subagent-fleet-inspector.png +0 -0
- package/dist/extensions/pi-subagents/.github/workflows/release.yml +28 -0
- package/dist/extensions/pi-subagents/.github/workflows/test.yml +51 -0
- package/dist/extensions/pi-subagents/.greptile/config.json +33 -0
- package/dist/extensions/pi-subagents/.greptile/files.json +8 -0
- package/dist/extensions/pi-subagents/.greptile/rules.md +16 -0
- package/dist/extensions/pi-subagents/CHANGELOG.md +309 -87
- package/dist/extensions/pi-subagents/README.md +15 -17
- package/dist/extensions/pi-subagents/agents/oracle.md +3 -1
- package/dist/extensions/pi-subagents/agents/researcher.md +32 -13
- package/dist/extensions/pi-subagents/agents/reviewer.md +13 -2
- package/dist/extensions/pi-subagents/agents/scout.md +2 -2
- package/dist/extensions/pi-subagents/agents/worker.md +2 -1
- package/dist/extensions/pi-subagents/async-retention-discovery-worker.mjs +180 -0
- package/dist/extensions/pi-subagents/docs/configuration.md +106 -27
- package/dist/extensions/pi-subagents/docs/extension-api.md +85 -21
- package/dist/extensions/pi-subagents/docs/missions.md +41 -4
- package/dist/extensions/pi-subagents/docs/models.md +52 -9
- package/dist/extensions/pi-subagents/docs/observability.md +103 -16
- package/dist/extensions/pi-subagents/docs/tool-reference.md +60 -45
- package/dist/extensions/pi-subagents/docs/watchdog.md +60 -3
- package/dist/extensions/pi-subagents/docs/workflows.md +181 -7
- package/dist/extensions/pi-subagents/index.ts +10 -1
- package/dist/extensions/pi-subagents/install.mjs +4 -4
- package/dist/extensions/pi-subagents/package-lock.json +1483 -1470
- package/dist/extensions/pi-subagents/package.json +6 -3
- package/dist/extensions/pi-subagents/prompts/council.md +60 -0
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +5 -1
- package/dist/extensions/pi-subagents/prompts/review-loop.md +9 -5
- package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +254 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +18 -17
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +31 -9
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +107 -140
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +9 -12
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +44 -92
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +261 -368
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +6 -2
- package/dist/extensions/pi-subagents/src/agents/agents.ts +388 -85
- package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +14 -0
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +418 -0
- package/dist/extensions/pi-subagents/src/agents/skills.ts +1 -1
- package/dist/extensions/pi-subagents/src/api/agents.ts +7 -0
- package/dist/extensions/pi-subagents/src/api/external-job-provider.ts +195 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +88 -27
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +2 -0
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +2 -0
- package/dist/extensions/pi-subagents/src/extension/config.ts +20 -11
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +14 -6
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +5 -4
- package/dist/extensions/pi-subagents/src/extension/index.ts +270 -187
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +65 -28
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +120 -11
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +46 -64
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +51 -37
- package/dist/extensions/pi-subagents/src/extension/tool-result.ts +19 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +2 -2
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +3 -3
- package/dist/extensions/pi-subagents/src/inspectors/herdr/focus.ts +55 -0
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +2 -1
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +230 -46
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +26 -4
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +32 -10
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +6 -1
- package/dist/extensions/pi-subagents/src/missions/store.ts +4 -9
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +2 -2
- package/dist/extensions/pi-subagents/src/policy/authority.ts +2 -0
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +3 -1
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +31 -8
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +210 -52
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +63 -33
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +71 -17
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +886 -0
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +14 -5
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +49 -56
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +1 -0
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +3 -33
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +5 -0
- package/dist/extensions/pi-subagents/src/runs/background/completion-dedupe.ts +5 -1
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +22 -12
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +105 -71
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +68 -19
- package/dist/extensions/pi-subagents/src/runs/background/index-segment.ts +59 -0
- package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +443 -0
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +94 -10
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +158 -90
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +141 -53
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +8 -5
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +14 -4
- package/dist/extensions/pi-subagents/src/runs/background/run-id-query.ts +7 -0
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +13 -14
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +46 -25
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +823 -0
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +9 -3
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +11 -1
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +594 -216
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +17 -13
- package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +138 -0
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +23 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +82 -4
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +5 -3
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +21 -14
- package/dist/extensions/pi-subagents/src/runs/foreground/async-stop-action.ts +23 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +153 -58
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +7 -9
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +1283 -1657
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +274 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +6 -5
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +59 -10
- package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/chain-outputs.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +36 -0
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +52 -2
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/extension-bindings.ts +78 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +2 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-bridge.ts +460 -0
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-runner.ts +389 -0
- package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +10 -0
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +14 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +243 -0
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +201 -85
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +106 -39
- package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +145 -0
- package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +150 -27
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +46 -4
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +19 -15
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +5 -1
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +86 -2
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +9 -9
- package/dist/extensions/pi-subagents/src/runs/shared/session-lease.ts +0 -6
- package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +18 -4
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +51 -7
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +62 -21
- package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/tool-timeout.ts +1 -3
- package/dist/extensions/pi-subagents/src/runs/shared/workflow-graph.ts +1 -23
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +14 -2
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +2 -2
- package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +22 -2
- package/dist/extensions/pi-subagents/src/shared/capacity-resilient-json.ts +102 -0
- package/dist/extensions/pi-subagents/src/shared/completion-owner.ts +14 -0
- package/dist/extensions/pi-subagents/src/shared/file-system-retry.ts +49 -1
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +59 -1
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +12 -5
- package/dist/extensions/pi-subagents/src/shared/model-info.ts +20 -0
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +0 -40
- package/dist/extensions/pi-subagents/src/shared/settings.ts +11 -30
- package/dist/extensions/pi-subagents/src/shared/thinking-ceiling.ts +52 -0
- package/dist/extensions/pi-subagents/src/shared/types.ts +228 -49
- package/dist/extensions/pi-subagents/src/shared/utils.ts +11 -3
- package/dist/extensions/pi-subagents/src/shared/watch-strategy.ts +10 -0
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +0 -162
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +2 -5
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +105 -13
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +6 -36
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +829 -0
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +1415 -0
- package/dist/extensions/pi-subagents/src/tui/render.ts +78 -7
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +1 -1
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +1 -0
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +59 -51
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +8 -2
- package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +2 -1
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +4 -4
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +471 -86
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +140 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +57 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +96 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +85 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +620 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +56 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +49 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +93 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +128 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +38 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +171 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +1261 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +358 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +512 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +43 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +121 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +82 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +210 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +55 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +206 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +356 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +297 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +60 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +68 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +106 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +51 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +40 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +37 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +70 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +36 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +61 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +35 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +32 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +54 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +42 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +77 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +63 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +14 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +394 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +29 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +120 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +28 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +246 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +457 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +22 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +4 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +8 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +26 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +7 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +10 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +18 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +16 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +9 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +21 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +31 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +5 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +12 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +15 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/index.mjs +1 -1
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +0 -54
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +1053 -414
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +194 -4
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +59 -4
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +0 -77
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +107 -6
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +211 -897
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +265 -375
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +77 -7
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +10 -10
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +547 -30
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +2112 -310
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +274 -34
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +20 -3
- package/dist/extensions/pi-subagents/test/support/isolated-temp-root.mjs +9 -0
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +30 -5
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +4 -2
- package/dist/extensions/pi-subagents/test/support/register-loader.mjs +1 -0
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +197 -0
- package/dist/extensions/pi-subagents/test/unit/agent-contract.test.ts +14 -0
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +204 -27
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +444 -145
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +256 -4
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +9 -7
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +152 -22
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +29 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +205 -23
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +579 -0
- package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/unit/capacity-resilient-json.test.ts +155 -0
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +7 -0
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +123 -0
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +81 -3
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +109 -7
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +5 -2
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +3 -2
- package/dist/extensions/pi-subagents/test/unit/extension-bindings.test.ts +79 -0
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/external-job-runner.test.ts +961 -0
- package/dist/extensions/pi-subagents/test/unit/file-system-retry.test.ts +64 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +1110 -0
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +1664 -0
- package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +81 -1
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +138 -11
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +41 -2
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +210 -79
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +95 -0
- package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +596 -0
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +10 -1
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +3 -5
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +167 -0
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +319 -18
- package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +78 -0
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +19 -5
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +44 -0
- package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +129 -0
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +231 -2
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +28 -1
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +106 -2
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +204 -7
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +59 -4
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +2 -6
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +34 -2
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +116 -6
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +12 -3
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +56 -61
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +416 -1
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +9 -2
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +42 -0
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +21 -30
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +86 -11
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +49 -1
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +233 -5
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +28 -5
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +323 -20
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +66 -10
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +68 -5
- package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +174 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +679 -0
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +67 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +55 -44
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +399 -84
- package/dist/extensions/pi-subagents/test/unit/session-lease.test.ts +13 -0
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +15 -10
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +11 -7
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +2 -0
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +40 -1
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +10 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +38 -3
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +110 -12
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +204 -19
- package/dist/extensions/pi-subagents/test/unit/temp-paths.test.ts +25 -0
- package/dist/extensions/pi-subagents/test/unit/thinking-ceiling.test.ts +73 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +90 -50
- package/dist/extensions/pi-subagents/test/unit/tool-timeout.test.ts +1 -2
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +234 -7
- package/dist/extensions/pi-subagents/test/unit/watch-strategy.test.ts +24 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +36 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +37 -9
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +302 -0
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +167 -7
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +113 -0
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +6 -6
- package/dist/extensions/ponytail/index.js +31 -25
- package/dist/extensions/ponytail/ponytail-config.cjs +34 -7
- package/dist/extensions/ponytail/ponytail-instructions.cjs +7 -9
- package/dist/extensions/ponytail/test/extension.test.js +7 -8
- package/dist/extensions/ponytail/test/helpers.test.js +1 -1
- package/dist/skills/brandkit/SKILL.md +799 -0
- package/dist/skills/design-taste-frontend/SKILL.md +1207 -0
- package/dist/skills/design-taste-frontend-v1/SKILL.md +227 -0
- package/dist/skills/full-output-enforcement/SKILL.md +50 -0
- package/dist/skills/gpt-taste/SKILL.md +75 -0
- package/dist/skills/high-end-visual-design/SKILL.md +99 -0
- package/dist/skills/image-to-code/SKILL.md +1229 -0
- package/dist/skills/imagegen-frontend-mobile/SKILL.md +1466 -0
- package/dist/skills/imagegen-frontend-web/SKILL.md +988 -0
- package/dist/skills/industrial-brutalist-ui/SKILL.md +93 -0
- package/dist/skills/minimalist-ui/SKILL.md +86 -0
- package/dist/skills/pi-subagents/SKILL.md +18 -17
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +31 -9
- package/dist/skills/pi-subagents/references/execution-controls.md +95 -143
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +9 -12
- package/dist/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +45 -94
- package/dist/skills/ponytail/SKILL.md +12 -8
- package/dist/skills/ponytail-audit/SKILL.md +0 -1
- package/dist/skills/ponytail-debt/SKILL.md +0 -1
- package/dist/skills/ponytail-gain/SKILL.md +0 -1
- package/dist/skills/ponytail-help/SKILL.md +4 -3
- package/dist/skills/ponytail-review/SKILL.md +0 -1
- package/dist/skills/redesign-existing-projects/SKILL.md +179 -0
- package/dist/skills/stitch-design-taste/SKILL.md +185 -0
- package/dist/skills/unlazy/CHANGELOG.md +100 -0
- package/dist/skills/unlazy/CONTRIBUTING.md +66 -0
- package/dist/skills/unlazy/LICENSE +21 -0
- package/dist/skills/unlazy/README.md +242 -0
- package/dist/skills/unlazy/SECURITY.md +70 -0
- package/dist/skills/unlazy/SKILL.md +100 -0
- package/dist/skills/unlazy/package.json +13 -0
- package/dist/skills/unlazy/references/dispatch.md +82 -0
- package/dist/skills/unlazy/references/gates.md +132 -0
- package/dist/skills/unlazy/references/method.md +49 -0
- package/dist/skills/unlazy/references/orchestration.md +99 -0
- package/dist/skills/unlazy/references/parallel.md +123 -0
- package/dist/skills/unlazy/references/token-economy.md +39 -0
- package/dist/skills/unlazy/research/validation-protocol.md +81 -0
- package/dist/skills/unlazy/scripts/dispatch-check.mjs +108 -0
- package/dist/skills/unlazy/scripts/gate-check.mjs +894 -0
- package/dist/skills/unlazy/scripts/gate-lint.mjs +178 -0
- package/dist/skills/unlazy/scripts/install-hooks.mjs +206 -0
- package/dist/skills/unlazy/scripts/lib/check-supervisor.mjs +46 -0
- package/dist/skills/unlazy/scripts/lib/dispatch.mjs +283 -0
- package/dist/skills/unlazy/scripts/lib/gates.mjs +629 -0
- package/dist/skills/unlazy/scripts/lib/process-tree.mjs +161 -0
- package/dist/skills/unlazy/scripts/lib/regex-worker.mjs +9 -0
- package/dist/skills/unlazy/scripts/stop-hook.mjs +174 -0
- package/dist/skills/unlazy/templates/PLAN.md +65 -0
- package/dist/skills/unlazy/templates/gates-leaf.md +51 -0
- package/dist/skills/unlazy/templates/gates-node.md +50 -0
- package/dist/skills/unlazy/tests/contract-tests.mjs +127 -0
- package/dist/skills/unlazy/tests/dispatch-tests.mjs +481 -0
- package/dist/skills/unlazy/tests/hardening-tests.mjs +903 -0
- package/dist/skills/unlazy/tests/lint-tests.mjs +242 -0
- package/dist/skills/unlazy/tests/run-tests.mjs +554 -0
- package/dist/skills/unlazy/tests/self-check.mjs +165 -0
- package/dist/skills/unlazy/tests/stress-tests.mjs +356 -0
- package/dist/skills/web-design-guidelines/SKILL.md +40 -0
- package/docs/settings.md +0 -5
- package/package.json +1 -1
- package/dist/core/tools/schema-prune.d.ts +0 -16
- package/dist/core/tools/schema-prune.js +0 -39
- package/dist/core/tools/schema-prune.test.d.ts +0 -1
- package/dist/core/tools/schema-prune.test.js +0 -111
- package/dist/extensions/pi-subagents/UPSTREAM-V0.50-MAPPING.md +0 -172
- package/dist/extensions/pi-subagents/prompts/parallel-context-build.md +0 -55
- package/dist/extensions/pi-subagents/prompts/parallel-handoff-plan.md +0 -61
- package/dist/extensions/pi-subagents/src/agents/task-aware-routing.ts +0 -132
- package/dist/extensions/pi-subagents/src/extension/chain-validation.ts +0 -181
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +0 -1354
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +0 -1581
- package/dist/extensions/pi-subagents/src/shared/env.ts +0 -16
- package/dist/extensions/pi-subagents/src/shared/session-lineage.ts +0 -71
- package/dist/extensions/pi-subagents/src/slash/inline-subagents.ts +0 -136
- package/dist/extensions/pi-subagents/src/workflows/workflow-auto-relaunch.ts +0 -41
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +0 -466
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +0 -1859
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +0 -733
- package/dist/extensions/pi-subagents/test/unit/builtin-agent-documentation.test.ts +0 -63
- package/dist/extensions/pi-subagents/test/unit/chain-validation.test.ts +0 -326
- package/dist/extensions/pi-subagents/test/unit/handoff-adoption.test.ts +0 -103
- package/dist/extensions/pi-subagents/test/unit/inline-subagents.test.ts +0 -127
- package/dist/extensions/pi-subagents/test/unit/session-lineage.test.ts +0 -73
- package/dist/extensions/pi-subagents/test/unit/task-aware-routing.test.ts +0 -213
- package/dist/extensions/pi-subagents/test/unit/workflow-auto-relaunch.test.ts +0 -65
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Best-effort process-tree cleanup shared by the gate runner and tests.
|
|
2
|
+
// Zero dependencies. Node 16+.
|
|
3
|
+
|
|
4
|
+
import { spawnSync as nodeSpawnSync } from "node:child_process";
|
|
5
|
+
import { win32 } from "node:path";
|
|
6
|
+
|
|
7
|
+
export const WINDOWS_TASKKILL_TIMEOUT_MS = 1000;
|
|
8
|
+
|
|
9
|
+
export function windowsTaskkillPath(env = process.env) {
|
|
10
|
+
const normalizeRoot = (value) => String(value || "").replace(/\//g, "\\").replace(/\\+$/, "");
|
|
11
|
+
const systemRoot = normalizeRoot(env.SystemRoot);
|
|
12
|
+
const windir = normalizeRoot(env.WINDIR);
|
|
13
|
+
const systemDrive = String(env.SystemDrive || "").replace(/[\\/]+$/, "").toUpperCase();
|
|
14
|
+
const driveRoot = /^[A-Za-z]:\\Windows$/i;
|
|
15
|
+
// Require the three standard Windows launcher values to identify the same
|
|
16
|
+
// drive-root directory. A single arbitrary absolute variable must not select
|
|
17
|
+
// an executable, and disagreement fails closed to the ChildProcess handle.
|
|
18
|
+
if (driveRoot.test(systemRoot) && driveRoot.test(windir) &&
|
|
19
|
+
systemRoot.toLowerCase() === windir.toLowerCase() &&
|
|
20
|
+
systemDrive === systemRoot.slice(0, 2).toUpperCase()) {
|
|
21
|
+
return win32.join(systemRoot, "System32", "taskkill.exe");
|
|
22
|
+
}
|
|
23
|
+
// A bare executable name consults cwd/PATH, which are controlled by the
|
|
24
|
+
// CHECK environment. If neither trusted system root exists, skip the helper
|
|
25
|
+
// and use the already-held ChildProcess handle instead.
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function syncFailure(result) {
|
|
30
|
+
if (!result) return "returned no result";
|
|
31
|
+
if (result.error) return result.error.code || result.error.message || "spawn error";
|
|
32
|
+
if (result.signal) return "signal " + result.signal;
|
|
33
|
+
if (result.status !== 0) return "exit " + String(result.status);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const childExited = (child) => child.exitCode !== null && child.exitCode !== undefined ||
|
|
38
|
+
child.signalCode !== null && child.signalCode !== undefined;
|
|
39
|
+
|
|
40
|
+
export function terminateProcessTree(child, options = {}) {
|
|
41
|
+
const platform = options.platform || process.platform;
|
|
42
|
+
const spawnSyncImpl = options.spawnSyncImpl || nodeSpawnSync;
|
|
43
|
+
const killGroup = options.killGroup || process.kill;
|
|
44
|
+
const pid = child && child.pid;
|
|
45
|
+
if (!Number.isInteger(pid) || pid <= 0) {
|
|
46
|
+
return { ok: false, fallback: false, diagnostic: "child PID is unavailable" };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (platform !== "win32") {
|
|
50
|
+
// The gate runner launches a detached Node supervisor as the group leader
|
|
51
|
+
// and keeps it alive until the shell and inherited stdout/stderr close. If
|
|
52
|
+
// Node has already observed that supervisor exit, the numeric PGID no
|
|
53
|
+
// longer carries identity and may have been reused; never signal it.
|
|
54
|
+
if (childExited(child)) {
|
|
55
|
+
return { ok: true, fallback: false, diagnostic: "process supervisor already exited" };
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
killGroup(-pid, "SIGKILL");
|
|
59
|
+
return { ok: true, fallback: false, diagnostic: null };
|
|
60
|
+
} catch (error) {
|
|
61
|
+
if (childExited(child)) {
|
|
62
|
+
return {
|
|
63
|
+
ok: true,
|
|
64
|
+
fallback: true,
|
|
65
|
+
diagnostic: "process-group kill failed (" + (error.code || error.message) + "); supervisor already exited",
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
const requested = child.kill("SIGKILL");
|
|
70
|
+
if (requested === false) {
|
|
71
|
+
return {
|
|
72
|
+
ok: false,
|
|
73
|
+
fallback: true,
|
|
74
|
+
diagnostic: "process-group kill failed (" + (error.code || error.message) +
|
|
75
|
+
"); child fallback returned false",
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
ok: true,
|
|
80
|
+
fallback: true,
|
|
81
|
+
diagnostic: "process-group kill failed (" + (error.code || error.message) + "); child fallback requested",
|
|
82
|
+
};
|
|
83
|
+
} catch (fallbackError) {
|
|
84
|
+
return {
|
|
85
|
+
ok: false,
|
|
86
|
+
fallback: true,
|
|
87
|
+
diagnostic: "process-group kill failed (" + (error.code || error.message) +
|
|
88
|
+
"); child fallback failed (" + (fallbackError.code || fallbackError.message) + ")",
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// taskkill addresses the stored leader PID, unlike a POSIX process-group
|
|
95
|
+
// request. Do not target it after Node reports exit because the PID may have
|
|
96
|
+
// been reused while an inherited pipe remains open.
|
|
97
|
+
if (childExited(child)) {
|
|
98
|
+
return { ok: true, fallback: false, diagnostic: "child already exited" };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const command = windowsTaskkillPath(options.env || process.env);
|
|
102
|
+
const requestedTimeout = Number(options.taskkillTimeoutMs);
|
|
103
|
+
const taskkillTimeoutMs = Number.isFinite(requestedTimeout) && requestedTimeout > 0
|
|
104
|
+
? Math.floor(requestedTimeout)
|
|
105
|
+
: WINDOWS_TASKKILL_TIMEOUT_MS;
|
|
106
|
+
let result;
|
|
107
|
+
let failure;
|
|
108
|
+
if (!command) {
|
|
109
|
+
failure = "trusted system taskkill path unavailable";
|
|
110
|
+
} else {
|
|
111
|
+
try {
|
|
112
|
+
result = spawnSyncImpl(command, ["/pid", String(pid), "/f", "/t"], {
|
|
113
|
+
stdio: "ignore",
|
|
114
|
+
windowsHide: true,
|
|
115
|
+
// Cleanup runs inside the gate timeout path. A broken helper must not
|
|
116
|
+
// replace a bounded CHECK with an unbounded synchronous wait.
|
|
117
|
+
timeout: taskkillTimeoutMs,
|
|
118
|
+
killSignal: "SIGKILL",
|
|
119
|
+
});
|
|
120
|
+
failure = syncFailure(result);
|
|
121
|
+
} catch (error) {
|
|
122
|
+
failure = error.code || error.message || "spawn threw";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (!failure) return { ok: true, fallback: false, diagnostic: null, command };
|
|
126
|
+
|
|
127
|
+
if (childExited(child)) {
|
|
128
|
+
return {
|
|
129
|
+
ok: true,
|
|
130
|
+
fallback: true,
|
|
131
|
+
command,
|
|
132
|
+
diagnostic: "taskkill failed (" + failure + "); child already exited",
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
try {
|
|
137
|
+
const requested = child.kill("SIGKILL");
|
|
138
|
+
if (requested === false) {
|
|
139
|
+
return {
|
|
140
|
+
ok: false,
|
|
141
|
+
fallback: true,
|
|
142
|
+
command,
|
|
143
|
+
diagnostic: "taskkill failed (" + failure + "); child fallback returned false",
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
ok: true,
|
|
148
|
+
fallback: true,
|
|
149
|
+
command,
|
|
150
|
+
diagnostic: "taskkill failed (" + failure + "); child fallback requested",
|
|
151
|
+
};
|
|
152
|
+
} catch (error) {
|
|
153
|
+
return {
|
|
154
|
+
ok: false,
|
|
155
|
+
fallback: true,
|
|
156
|
+
command,
|
|
157
|
+
diagnostic: "taskkill failed (" + failure + "); child fallback failed (" +
|
|
158
|
+
(error.code || error.message) + ")",
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { parentPort } from "node:worker_threads";
|
|
2
|
+
|
|
3
|
+
parentPort.once("message", ({ source, flags, output }) => {
|
|
4
|
+
try {
|
|
5
|
+
parentPort.postMessage({ matched: new RegExp(source, flags).test(output) });
|
|
6
|
+
} catch (error) {
|
|
7
|
+
parentPort.postMessage({ error: error.message });
|
|
8
|
+
}
|
|
9
|
+
});
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Claude Code Stop hook for one unlazy pipeline. Zero dependencies. Node 16+.
|
|
3
|
+
|
|
4
|
+
import { existsSync, readFileSync, unlinkSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import {
|
|
7
|
+
UNLAZY_DIR, gateState, hookStatePath, parseGates, qualify, resolveTarget,
|
|
8
|
+
sha256, validateScopeId, withFileLock, writeAtomic,
|
|
9
|
+
} from "./lib/gates.mjs";
|
|
10
|
+
import { dispatchStatus } from "./lib/dispatch.mjs";
|
|
11
|
+
|
|
12
|
+
const MAX_BLOCKS = 6;
|
|
13
|
+
const safeHostText = (value, max = 500) => String(value)
|
|
14
|
+
.replace(/[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, " ")
|
|
15
|
+
.replace(/\s+/g, " ")
|
|
16
|
+
.trim()
|
|
17
|
+
.slice(0, max);
|
|
18
|
+
|
|
19
|
+
function normalizeHookState(value) {
|
|
20
|
+
if (!value || typeof value !== "object" || Array.isArray(value) || value.schema !== 1 ||
|
|
21
|
+
!value.sessions || typeof value.sessions !== "object" || Array.isArray(value.sessions)) {
|
|
22
|
+
return { schema: 1, sessions: {} };
|
|
23
|
+
}
|
|
24
|
+
const sessions = {};
|
|
25
|
+
for (const [key, current] of Object.entries(value.sessions)) {
|
|
26
|
+
if (!/^[a-f0-9]{24}$/.test(key) || !current || typeof current !== "object" || Array.isArray(current) ||
|
|
27
|
+
!/^[a-f0-9]{24}$/.test(String(current.hash || "")) ||
|
|
28
|
+
!Number.isInteger(current.blocks) || current.blocks < 0 ||
|
|
29
|
+
typeof current.updatedAt !== "string" || Number.isNaN(Date.parse(current.updatedAt))) continue;
|
|
30
|
+
sessions[key] = current;
|
|
31
|
+
}
|
|
32
|
+
return { schema: 1, sessions };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const args = process.argv.slice(2);
|
|
36
|
+
const scopeIndex = args.indexOf("--scope");
|
|
37
|
+
const scopeArg = scopeIndex === -1 ? null : args[scopeIndex + 1];
|
|
38
|
+
|
|
39
|
+
const allow = (message) => {
|
|
40
|
+
if (message) console.log(JSON.stringify({ systemMessage: message }));
|
|
41
|
+
process.exit(0);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
if (scopeIndex !== -1 && (!scopeArg || validateScopeId(scopeArg))) {
|
|
45
|
+
allow("unlazy: installed hook has an invalid --scope value; not blocking.");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let payload = {};
|
|
49
|
+
try { payload = JSON.parse(readFileSync(0, "utf8") || "{}"); }
|
|
50
|
+
catch { allow(null); }
|
|
51
|
+
|
|
52
|
+
const root = resolve(typeof payload.cwd === "string" && payload.cwd ? payload.cwd : process.cwd());
|
|
53
|
+
const sessionId = payload.session_id || payload.sessionId || "anonymous";
|
|
54
|
+
const sessionKey = sha256(String(sessionId)).slice(0, 24);
|
|
55
|
+
const target = resolveTarget({ root, scope: scopeArg, sessionId });
|
|
56
|
+
|
|
57
|
+
if (target.ambiguous) {
|
|
58
|
+
allow("unlazy: " + target.ambiguous.length + " pipelines under " + UNLAZY_DIR +
|
|
59
|
+
"/ (" + target.ambiguous.join(", ") + ") and none bound to this session; not blocking.");
|
|
60
|
+
}
|
|
61
|
+
if (target.error && !target.ambiguous) allow("unlazy: " + safeHostText(target.error) + "; not blocking.");
|
|
62
|
+
|
|
63
|
+
const statePath = hookStatePath(root, target.scope);
|
|
64
|
+
|
|
65
|
+
async function clearSessionState() {
|
|
66
|
+
if (!existsSync(statePath)) return;
|
|
67
|
+
try {
|
|
68
|
+
await withFileLock(root, statePath, () => {
|
|
69
|
+
let state = { schema: 1, sessions: {} };
|
|
70
|
+
try { state = JSON.parse(readFileSync(statePath, "utf8")); } catch { /* replace invalid local state */ }
|
|
71
|
+
state = normalizeHookState(state);
|
|
72
|
+
delete state.sessions[sessionKey];
|
|
73
|
+
if (!Object.keys(state.sessions).length) {
|
|
74
|
+
try { unlinkSync(statePath); } catch { /* already absent */ }
|
|
75
|
+
} else writeAtomic(statePath, JSON.stringify(state, null, 2) + "\n", { root });
|
|
76
|
+
}, { timeoutMs: 10000 });
|
|
77
|
+
} catch {
|
|
78
|
+
// State cleanup must never trap a session after the gates are complete.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const dispatch = dispatchStatus(root, target.scope);
|
|
83
|
+
|
|
84
|
+
if (!target.files.length && !dispatch.blocking.length && !dispatch.abandoned.length) {
|
|
85
|
+
await clearSessionState();
|
|
86
|
+
allow(null);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const unmet = [...dispatch.blocking];
|
|
90
|
+
const invalid = [];
|
|
91
|
+
const handoffs = [...dispatch.abandoned];
|
|
92
|
+
const handoffMessage = () => {
|
|
93
|
+
if (!handoffs.length) return "";
|
|
94
|
+
const shown = handoffs.slice(0, 5).join(", ") +
|
|
95
|
+
(handoffs.length > 5 ? ", +" + (handoffs.length - 5) + " more" : "");
|
|
96
|
+
return " HANDOFF REQUIRED: " + handoffs.length + " abandoned item(s): " + safeHostText(shown) + ".";
|
|
97
|
+
};
|
|
98
|
+
// The loop guard compares resolved gate state between stops, not raw bytes.
|
|
99
|
+
// Byte comparison counted any edit as progress: a comment, a reflowed line, or
|
|
100
|
+
// the checker rewriting an evidence line with a fresh PATH hash. That rearmed
|
|
101
|
+
// the guard indefinitely, so the six-block release could only ever fire for an
|
|
102
|
+
// agent doing literally nothing, which is the one case least in need of it.
|
|
103
|
+
// Dispatch issue strings encode only canonical state and counts, not raw JSON
|
|
104
|
+
// bytes or timestamps, so metadata-only edits do not reset the same guard.
|
|
105
|
+
const resolved = [...dispatch.resolved];
|
|
106
|
+
for (const file of [...target.files].sort()) {
|
|
107
|
+
let text;
|
|
108
|
+
try { text = readFileSync(file, "utf8"); }
|
|
109
|
+
catch (error) {
|
|
110
|
+
invalid.push(qualify(file, "PARSE") + " unreadable: " + safeHostText(error.message));
|
|
111
|
+
resolved.push(qualify(file, "PARSE") + "=unreadable");
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const doc = parseGates(text);
|
|
115
|
+
if (doc.errors.length) {
|
|
116
|
+
invalid.push(qualify(file, "PARSE") + " " + doc.errors.slice(0, 2).map((error) => safeHostText(error)).join("; "));
|
|
117
|
+
// Record only that the ledger is invalid. Diagnostic text carries line
|
|
118
|
+
// numbers, which shift on an unrelated edit and would restore byte coupling.
|
|
119
|
+
resolved.push(qualify(file, "PARSE") + "=invalid");
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
for (const gate of doc.gates) {
|
|
123
|
+
const state = gateState(gate, doc.abandoned);
|
|
124
|
+
resolved.push(qualify(file, gate.id) + "=" + state);
|
|
125
|
+
if (state === "unmet" || state === "unmet-no-evidence") unmet.push(qualify(file, gate.id));
|
|
126
|
+
else if (state === "abandoned") handoffs.push(qualify(file, gate.id));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (!unmet.length && !invalid.length) {
|
|
131
|
+
await clearSessionState();
|
|
132
|
+
if (!handoffs.length) allow(null);
|
|
133
|
+
const where = target.scope ? " [scope " + target.scope + "]" : "";
|
|
134
|
+
allow("unlazy" + where + ":" + handoffMessage());
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const progressHash = sha256(resolved.sort().join("\0")).slice(0, 24);
|
|
138
|
+
let sessionState;
|
|
139
|
+
try {
|
|
140
|
+
sessionState = await withFileLock(root, statePath, () => {
|
|
141
|
+
let state = { schema: 1, sessions: {} };
|
|
142
|
+
try { state = JSON.parse(readFileSync(statePath, "utf8")); } catch { /* new or corrupt local state */ }
|
|
143
|
+
state = normalizeHookState(state);
|
|
144
|
+
let current = state.sessions[sessionKey];
|
|
145
|
+
if (!current || current.hash !== progressHash) current = { hash: progressHash, blocks: 0 };
|
|
146
|
+
current.blocks += 1;
|
|
147
|
+
current.updatedAt = new Date().toISOString();
|
|
148
|
+
state.sessions[sessionKey] = current;
|
|
149
|
+
// Bound abandoned session debris without mixing counters between sessions.
|
|
150
|
+
const entries = Object.entries(state.sessions).sort((a, b) => String(b[1].updatedAt).localeCompare(String(a[1].updatedAt)));
|
|
151
|
+
state.sessions = Object.fromEntries(entries.slice(0, 64));
|
|
152
|
+
writeAtomic(statePath, JSON.stringify(state, null, 2) + "\n", { root });
|
|
153
|
+
return current;
|
|
154
|
+
}, { timeoutMs: 10000 });
|
|
155
|
+
} catch (error) {
|
|
156
|
+
allow("unlazy: could not update the serialized hook state (" + safeHostText(error.message) + "); not blocking to avoid a trap.");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const where = target.scope ? " [scope " + target.scope + "]" : "";
|
|
160
|
+
const outstanding = [...invalid, ...unmet].map((item) => safeHostText(item));
|
|
161
|
+
if (sessionState.blocks > MAX_BLOCKS) {
|
|
162
|
+
allow("unlazy: releasing after " + MAX_BLOCKS + " blocks without gate progress" + where +
|
|
163
|
+
"; " + outstanding.length + " item(s) remain (" + outstanding.slice(0, 4).join(", ") + ")." +
|
|
164
|
+
handoffMessage());
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const list = outstanding.slice(0, 5).join(", ") + (outstanding.length > 5 ? ", +" + (outstanding.length - 5) + " more" : "");
|
|
168
|
+
console.log(JSON.stringify({
|
|
169
|
+
decision: "block",
|
|
170
|
+
reason: "unlazy" + where + ": " + outstanding.length + " gate/ledger/dispatch item(s) need work: " + list +
|
|
171
|
+
". Run gate-check.mjs --status to inspect without execution. To run inherited CHECK lines, inspect them and use --approve. " +
|
|
172
|
+
"Use ABANDON: <id> <non-blank reason> only when a gate is genuinely impossible." + handoffMessage(),
|
|
173
|
+
}));
|
|
174
|
+
process.exit(0);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Plan: <task>
|
|
2
|
+
|
|
3
|
+
Scope: <validated pipeline id; store this file at .unlazy/<scope>/PLAN.md>
|
|
4
|
+
Depth: tree <N>
|
|
5
|
+
Mode: orchestrated
|
|
6
|
+
|
|
7
|
+
## Contract
|
|
8
|
+
|
|
9
|
+
Decide before fan-out:
|
|
10
|
+
|
|
11
|
+
- Interfaces: <signatures, schemas, formats, integration points>
|
|
12
|
+
- Ownership: <one complete set of repository-relative paths per leaf; no absolute paths, traversal, or concurrent overlap>
|
|
13
|
+
- Dependencies: <leaf ids that must be VERIFIED first>
|
|
14
|
+
- Host launch mode: <Codex native subagents | Claude background Agents | Claude Dynamic Workflow | sequential fallback>
|
|
15
|
+
- Wave policy: <which independent READY leaves launch together and the maximum host concurrency>
|
|
16
|
+
- Toolchain: <runtime versions, shell, working-directory rules, test commands>
|
|
17
|
+
- Conventions: <naming, errors, compatibility, formatting>
|
|
18
|
+
- Manual review: <owner and evidence standard for consequential manual gates>
|
|
19
|
+
|
|
20
|
+
## Current contract inventory
|
|
21
|
+
|
|
22
|
+
Contract revision: 1. Before fan-out, reread the original request and current amendments. Record every independently omittable required outcome and every constraint that changes acceptance; do not copy credentials, private text, or unrelated context.
|
|
23
|
+
|
|
24
|
+
| ID | Required outcome or constraint | Owner | Observing gate or manual review | Disposition | Revision |
|
|
25
|
+
|---|---|---|---|---|---|
|
|
26
|
+
| C1 | <concise paraphrase> | <leaf/node> | <qualified gate/reviewer> | ACTIVE | 1 |
|
|
27
|
+
|
|
28
|
+
Use stable ids. On an amendment, increment the revision and reconcile every affected row before dispatch or completion credit. `ACTIVE` is complete only with a current owner and observation. `ABANDONED`, `DEFERRED`, and `OWNER_DECISION` are honest non-completion; only explicit user authority may use `REMOVED_BY_USER`.
|
|
29
|
+
|
|
30
|
+
## State vocabulary
|
|
31
|
+
|
|
32
|
+
Leaf state is exactly one of:
|
|
33
|
+
|
|
34
|
+
- WAITING: at least one id in Needs is not VERIFIED
|
|
35
|
+
- READY: dependencies are VERIFIED and ownership can be claimed
|
|
36
|
+
- IN-FLIGHT: dispatched, not yet parent-verified
|
|
37
|
+
- VERIFIED: parent --reverify passed and manual gates were reviewed
|
|
38
|
+
- ABANDONED: a required gate has a visible handoff
|
|
39
|
+
|
|
40
|
+
Branch state is exactly one of OPEN, VERIFIED, or ABANDONED.
|
|
41
|
+
|
|
42
|
+
## Tree
|
|
43
|
+
|
|
44
|
+
Use `leaf-` paths for work leaves and `node-` paths for branch integration.
|
|
45
|
+
|
|
46
|
+
- 1 <task> .............. GATES.md ..................... State: OPEN
|
|
47
|
+
- 1.1 <branch> ........ gates/node-1.1.md ............ State: OPEN
|
|
48
|
+
- 1.1.1 <leaf> ...... gates/leaf-1.1.1.md .......... Needs: - ...... State: READY
|
|
49
|
+
- 1.1.2 <leaf> ...... gates/leaf-1.1.2.md .......... Needs: - ...... State: READY
|
|
50
|
+
- 1.2 <branch> ........ gates/node-1.2.md ............ State: OPEN
|
|
51
|
+
- 1.2.1 <leaf> ...... gates/leaf-1.2.1.md .......... Needs: - ...... State: READY
|
|
52
|
+
- 1.2.2 <leaf> ...... gates/leaf-1.2.2.md .......... Needs: 1.2.1 .. State: WAITING
|
|
53
|
+
|
|
54
|
+
Every leaf repeats its complete ownership as an `OWNS:` header in its ledger. Claim each concurrently dispatched leaf with `--claim`, then open and seal a native launch wave as described in `references/dispatch.md` before changing its state to IN-FLIGHT.
|
|
55
|
+
|
|
56
|
+
## Status log
|
|
57
|
+
|
|
58
|
+
Append events to `.unlazy/<scope>/status.log`; do not copy the event history into this file:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
node <skill-dir>/scripts/gate-check.mjs --scope <scope> --log "leaf-1.1.1 dispatched"
|
|
62
|
+
node <skill-dir>/scripts/gate-check.mjs --scope <scope> --log "leaf-1.1.1 verified"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Record contract amendments, plan changes, dispatch, parent verification, abandonment, branch integration, and lease release. Update the live State and Needs fields above when state changes; keep the log append-only. Before root completion, reread the current request and review every current inventory row against its owner and observing gate or manual review.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Gates: <leaf or task name>
|
|
2
|
+
|
|
3
|
+
OWNS: <repository-relative globs this leaf may write, for example src/api/**, tests/api/**>
|
|
4
|
+
|
|
5
|
+
Scope: <one sentence describing the complete deliverable>
|
|
6
|
+
|
|
7
|
+
- [ ] G1: <observable outcome measured directly from the artifact>
|
|
8
|
+
CHECK: node scripts/verify-outcome.mjs
|
|
9
|
+
EXPECT: outcome verification passed
|
|
10
|
+
EVIDENCE: pending
|
|
11
|
+
|
|
12
|
+
- [ ] G2: <integration outcome in a subproject>
|
|
13
|
+
CHECK: node scripts/verify-integration.mjs
|
|
14
|
+
EXPECT: integration verification passed
|
|
15
|
+
CWD: packages/example
|
|
16
|
+
EVIDENCE: pending
|
|
17
|
+
|
|
18
|
+
- [ ] G3: <manual outcome that no command can decide>
|
|
19
|
+
EVIDENCE: pending
|
|
20
|
+
|
|
21
|
+
<!--
|
|
22
|
+
Replace every placeholder before running the checker.
|
|
23
|
+
|
|
24
|
+
Strict format:
|
|
25
|
+
- Use a unique explicit id for every gate.
|
|
26
|
+
- Indent CHECK, EXPECT, CWD, and EVIDENCE.
|
|
27
|
+
- Give a runnable gate both CHECK and EXPECT; give a manual gate neither.
|
|
28
|
+
- Success requires process exit 0 and EXPECT.
|
|
29
|
+
- Make EXPECT a success-only marker produced after every assertion passes.
|
|
30
|
+
- For an absence or negative assertion, test the same checker against a known
|
|
31
|
+
positive fixture and record that control in the gate's manual review.
|
|
32
|
+
- Measure supplied figures from source. Do not copy a supplied number into
|
|
33
|
+
EXPECT as its own proof.
|
|
34
|
+
- Use repository-owned Node scripts for portable examples. Declare any
|
|
35
|
+
non-default shell or external tool requirement explicitly.
|
|
36
|
+
- Scoped and legacy discovery anchor checks at the repository root. When this
|
|
37
|
+
ledger is named explicitly from `.unlazy/`, pass an explicit repository
|
|
38
|
+
`--root` and `--cwd` so repository-relative commands keep the same base.
|
|
39
|
+
- Record exact manual evidence and review consequential manual gates by risk.
|
|
40
|
+
- OWNS paths must be repository-relative, complete, and disjoint from every
|
|
41
|
+
concurrently dispatched leaf. Claims coordinate writers; they do not sandbox.
|
|
42
|
+
|
|
43
|
+
If a gate becomes genuinely impossible, keep the gate and add:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
ABANDON: G<n> <non-empty reason and handoff>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Surface every abandonment as a non-successful handoff in the final report; an
|
|
50
|
+
abandoned leaf is not complete. See references/gates.md.
|
|
51
|
+
-->
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Gates: <branch name> integration
|
|
2
|
+
|
|
3
|
+
Scope: integrate children <explicit child ids> into one verified result
|
|
4
|
+
|
|
5
|
+
- [ ] N1: every named child leaf is reverified from its exact ledger
|
|
6
|
+
CHECK: node <skill-dir>/scripts/gate-check.mjs --root . --cwd . --reverify --jobs 1 .unlazy/<scope>/gates/leaf-<a>.md .unlazy/<scope>/gates/leaf-<b>.md
|
|
7
|
+
EXPECT: ALL MET
|
|
8
|
+
EVIDENCE: pending
|
|
9
|
+
|
|
10
|
+
- [ ] N2: child interfaces match the contract in PLAN.md
|
|
11
|
+
CHECK: node scripts/verify-interfaces.mjs
|
|
12
|
+
EXPECT: interface verification passed
|
|
13
|
+
EVIDENCE: pending
|
|
14
|
+
|
|
15
|
+
- [ ] N3: cross-child behavior works end to end
|
|
16
|
+
CHECK: node scripts/verify-integration.mjs
|
|
17
|
+
EXPECT: integration verification passed
|
|
18
|
+
EVIDENCE: pending
|
|
19
|
+
|
|
20
|
+
- [ ] N4: affected sibling behavior has not regressed
|
|
21
|
+
CHECK: node scripts/verify-regressions.mjs
|
|
22
|
+
EXPECT: regression verification passed
|
|
23
|
+
EVIDENCE: pending
|
|
24
|
+
|
|
25
|
+
- [ ] N5: every direct child ownership lease was released after parent verification
|
|
26
|
+
EVIDENCE: pending
|
|
27
|
+
|
|
28
|
+
- [ ] N6: consequential manual outcomes from the children were reviewed at branch level
|
|
29
|
+
EVIDENCE: pending
|
|
30
|
+
|
|
31
|
+
<!--
|
|
32
|
+
Replace every placeholder before running the checker.
|
|
33
|
+
|
|
34
|
+
N1 must name every direct child explicitly and use --reverify, not --status.
|
|
35
|
+
Status reports old evidence without executing it. Keep --jobs 1 unless the child
|
|
36
|
+
checks are independent and deterministic parallel execution is intentional.
|
|
37
|
+
If a child reports an abandonment, N1 exits 1 with `HANDOFF REQUIRED`. Mark the
|
|
38
|
+
branch ABANDONED and surface the handoff; never rewrite that result as completion.
|
|
39
|
+
|
|
40
|
+
Branch paths use node-<id>.md. Leaf paths use leaf-<id>.md. Branch completion
|
|
41
|
+
requires integration evidence; a set of locally complete leaves is not enough.
|
|
42
|
+
|
|
43
|
+
For N5, run this once for each direct child after verification and record the
|
|
44
|
+
outputs as manual evidence:
|
|
45
|
+
|
|
46
|
+
node <skill-dir>/scripts/gate-check.mjs --scope <scope> --leaf leaf-<id> --release
|
|
47
|
+
|
|
48
|
+
Drop N5 only when no child claimed ownership. See references/orchestration.md
|
|
49
|
+
and references/parallel.md.
|
|
50
|
+
-->
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Focused fixtures for PLAN contract reconciliation. Zero dependencies.
|
|
3
|
+
//
|
|
4
|
+
// The required ids below stand for a human reread of the current request. This
|
|
5
|
+
// test intentionally does not infer requirements from prose; it checks that the
|
|
6
|
+
// documented inventory control can discriminate omissions once that authority
|
|
7
|
+
// is supplied.
|
|
8
|
+
|
|
9
|
+
import assert from "node:assert/strict";
|
|
10
|
+
|
|
11
|
+
const tests = [];
|
|
12
|
+
const test = (name, fn) => tests.push({ name, fn });
|
|
13
|
+
|
|
14
|
+
function reviewContract(spec) {
|
|
15
|
+
const gaps = [];
|
|
16
|
+
const rows = new Map();
|
|
17
|
+
for (const row of spec.rows) {
|
|
18
|
+
if (rows.has(row.id)) gaps.push(row.id + ": duplicate row");
|
|
19
|
+
rows.set(row.id, row);
|
|
20
|
+
}
|
|
21
|
+
for (const id of spec.required) {
|
|
22
|
+
const row = rows.get(id);
|
|
23
|
+
if (!row) { gaps.push(id + ": missing row"); continue; }
|
|
24
|
+
if (row.revision !== spec.revision) gaps.push(id + ": stale revision");
|
|
25
|
+
if (row.disposition === "REMOVED_BY_USER") {
|
|
26
|
+
if (!spec.removedByUser.has(id)) gaps.push(id + ": removal lacks explicit user authority");
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (row.disposition !== "ACTIVE") gaps.push(id + ": non-completion disposition " + row.disposition);
|
|
30
|
+
if (!row.owner || !spec.owners.has(row.owner)) gaps.push(id + ": missing or stale owner");
|
|
31
|
+
if (!row.observation || !spec.observations.has(row.observation)) {
|
|
32
|
+
gaps.push(id + ": missing or stale observation");
|
|
33
|
+
} else if (!spec.observations.get(row.observation).has(id)) {
|
|
34
|
+
gaps.push(id + ": observation does not cover outcome");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return gaps;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const base = () => ({
|
|
41
|
+
required: ["A", "B"],
|
|
42
|
+
revision: 1,
|
|
43
|
+
removedByUser: new Set(),
|
|
44
|
+
owners: new Set(["leaf-a", "leaf-b"]),
|
|
45
|
+
observations: new Map([["GA", new Set(["A"])], ["GB", new Set(["B"])]]),
|
|
46
|
+
rows: [
|
|
47
|
+
{ id: "A", owner: "leaf-a", observation: "GA", disposition: "ACTIVE", revision: 1 },
|
|
48
|
+
{ id: "B", owner: "leaf-b", observation: "GB", disposition: "ACTIVE", revision: 1 },
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("contract: A and B mapped to live owners and observations reconcile", () => {
|
|
53
|
+
assert.deepEqual(reviewContract(base()), []);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("contract: an omitted B is reported", () => {
|
|
57
|
+
const spec = base();
|
|
58
|
+
spec.rows.pop();
|
|
59
|
+
assert.match(reviewContract(spec).join("\n"), /B: missing row/);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("contract: an unowned B is reported", () => {
|
|
63
|
+
const spec = base();
|
|
64
|
+
spec.rows[1].owner = "";
|
|
65
|
+
assert.match(reviewContract(spec).join("\n"), /B: missing or stale owner/);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test("contract: missing, stale, or wrong observations are reported", () => {
|
|
69
|
+
const missing = base();
|
|
70
|
+
missing.rows[1].observation = "";
|
|
71
|
+
assert.match(reviewContract(missing).join("\n"), /missing or stale observation/);
|
|
72
|
+
const stale = base();
|
|
73
|
+
stale.rows[1].observation = "OLD";
|
|
74
|
+
assert.match(reviewContract(stale).join("\n"), /missing or stale observation/);
|
|
75
|
+
const wrong = base();
|
|
76
|
+
wrong.rows[1].observation = "GA";
|
|
77
|
+
assert.match(reviewContract(wrong).join("\n"), /does not cover outcome/);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test("contract: explicit removal is distinct from abandonment or deferment", () => {
|
|
81
|
+
const removed = base();
|
|
82
|
+
removed.rows[1].disposition = "REMOVED_BY_USER";
|
|
83
|
+
removed.removedByUser.add("B");
|
|
84
|
+
assert.deepEqual(reviewContract(removed), []);
|
|
85
|
+
for (const disposition of ["ABANDONED", "DEFERRED", "OWNER_DECISION"]) {
|
|
86
|
+
const spec = base();
|
|
87
|
+
spec.rows[1].disposition = disposition;
|
|
88
|
+
assert.match(reviewContract(spec).join("\n"), new RegExp("non-completion disposition " + disposition));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test("contract: amendment C invalidates the prior revision until reconciled", () => {
|
|
93
|
+
const spec = base();
|
|
94
|
+
spec.revision = 2;
|
|
95
|
+
spec.required.push("C");
|
|
96
|
+
assert.match(reviewContract(spec).join("\n"), /stale revision/);
|
|
97
|
+
assert.match(reviewContract(spec).join("\n"), /C: missing row/);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test("contract: acceptance constraints count while optional ideas do not", () => {
|
|
101
|
+
const spec = base();
|
|
102
|
+
spec.required.push("NO_WRITE");
|
|
103
|
+
spec.optional = ["NICE_TO_HAVE"];
|
|
104
|
+
assert.match(reviewContract(spec).join("\n"), /NO_WRITE: missing row/);
|
|
105
|
+
assert.doesNotMatch(reviewContract(spec).join("\n"), /NICE_TO_HAVE/);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test("contract: a table cannot pass without the current request denominator", () => {
|
|
109
|
+
const spec = base();
|
|
110
|
+
spec.rows = [spec.rows[0]];
|
|
111
|
+
assert.notDeepEqual(reviewContract(spec), []);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
let passed = 0;
|
|
115
|
+
const failures = [];
|
|
116
|
+
for (const current of tests) {
|
|
117
|
+
try {
|
|
118
|
+
current.fn();
|
|
119
|
+
passed++;
|
|
120
|
+
console.log("ok " + current.name);
|
|
121
|
+
} catch (error) {
|
|
122
|
+
failures.push(current.name);
|
|
123
|
+
console.log("FAIL " + current.name + "\n " + String(error.message).replace(/\n/g, "\n "));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
console.log("\n" + passed + "/" + tests.length + " passed");
|
|
127
|
+
process.exit(failures.length ? 1 : 0);
|