supipowers 1.5.3 → 2.0.1
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/README.md +14 -8
- package/bin/install.mjs +20 -5
- package/bin/install.ts +95 -0
- package/package.json +8 -4
- package/skills/context-mode/SKILL.md +17 -10
- package/skills/harness/SKILL.md +94 -0
- package/skills/ui-design/SKILL.md +63 -0
- package/skills/ui-design/sub-agent-templates/component-builder.md +29 -0
- package/skills/ui-design/sub-agent-templates/design-critic.md +46 -0
- package/skills/ui-design/sub-agent-templates/pencil/component-builder.md +29 -0
- package/skills/ui-design/sub-agent-templates/pencil/design-critic.md +42 -0
- package/skills/ui-design/sub-agent-templates/pencil/section-assembler.md +27 -0
- package/skills/ui-design/sub-agent-templates/section-assembler.md +27 -0
- package/skills/ultraplan-discover/SKILL.md +96 -0
- package/skills/ultraplan-intake/SKILL.md +89 -0
- package/skills/ultraplan-research/SKILL.md +129 -0
- package/skills/ultraplan-review/SKILL.md +86 -0
- package/skills/ultraplan-review-scope/SKILL.md +111 -0
- package/skills/ultraplan-review-structure/SKILL.md +120 -0
- package/skills/ultraplan-review-tdd/SKILL.md +142 -0
- package/skills/ultraplan-scout/SKILL.md +110 -0
- package/skills/ultraplan-synthesize/SKILL.md +124 -0
- package/src/{quality/ai-session.ts → ai/final-message.ts} +27 -0
- package/src/ai/schema-text.ts +129 -0
- package/src/ai/structured-output.ts +274 -0
- package/src/ai/template.ts +27 -0
- package/src/bootstrap.ts +63 -28
- package/src/commands/agents.ts +131 -42
- package/src/commands/ai-review.ts +251 -30
- package/src/commands/clear.ts +434 -0
- package/src/commands/commit.ts +1 -0
- package/src/commands/config.ts +242 -44
- package/src/commands/context.ts +55 -28
- package/src/commands/doctor.ts +234 -6
- package/src/commands/fix-pr.ts +306 -131
- package/src/commands/generate.ts +111 -21
- package/src/commands/memory.ts +192 -0
- package/src/commands/model-picker.ts +28 -21
- package/src/commands/model.ts +18 -8
- package/src/commands/optimize-context.ts +408 -29
- package/src/commands/plan.ts +2 -0
- package/src/commands/qa.ts +312 -137
- package/src/commands/release.ts +259 -76
- package/src/commands/review.ts +293 -59
- package/src/commands/status.ts +200 -13
- package/src/commands/supi.ts +3 -35
- package/src/commands/ui-design.ts +394 -0
- package/src/commands/ultraplan.ts +1518 -0
- package/src/commands/update.ts +86 -0
- package/src/config/defaults.ts +62 -0
- package/src/config/loader.ts +448 -60
- package/src/config/schema.ts +108 -2
- package/src/context/optimizer.ts +25 -33
- package/src/context/rule-renderer.ts +223 -0
- package/src/context/savings.ts +258 -0
- package/src/context/startup-check.ts +380 -0
- package/src/context/startup-optimizer.ts +355 -0
- package/src/context/tokenignore.ts +146 -0
- package/src/context-mode/cache-handle.ts +49 -0
- package/src/context-mode/cache-preview.ts +71 -0
- package/src/context-mode/cache-store.ts +738 -0
- package/src/context-mode/compressor.ts +131 -26
- package/src/context-mode/dedup.ts +108 -0
- package/src/context-mode/detector.ts +35 -4
- package/src/context-mode/event-extractor.ts +14 -12
- package/src/context-mode/event-store.ts +91 -36
- package/src/context-mode/hooks.ts +798 -56
- package/src/context-mode/knowledge/store.ts +255 -11
- package/src/context-mode/memory-store.ts +325 -0
- package/src/context-mode/metrics-recorder.ts +158 -0
- package/src/context-mode/metrics-store.ts +765 -0
- package/src/context-mode/model.ts +24 -0
- package/src/context-mode/processor-keys.ts +29 -0
- package/src/context-mode/processors/build.ts +66 -0
- package/src/context-mode/processors/docker.ts +57 -0
- package/src/context-mode/processors/git.ts +111 -0
- package/src/context-mode/processors/json.ts +112 -0
- package/src/context-mode/processors/k8s.ts +67 -0
- package/src/context-mode/processors/lint.ts +67 -0
- package/src/context-mode/processors/log.ts +86 -0
- package/src/context-mode/processors/registry.ts +116 -0
- package/src/context-mode/processors/test-runner.ts +102 -0
- package/src/context-mode/processors/types.ts +20 -0
- package/src/context-mode/repomap.ts +400 -0
- package/src/context-mode/routing.ts +97 -24
- package/src/context-mode/sandbox/runners.ts +5 -1
- package/src/context-mode/snapshot-builder.ts +106 -11
- package/src/context-mode/source-hash.ts +173 -0
- package/src/context-mode/tool-name.ts +11 -0
- package/src/context-mode/tools.ts +654 -22
- package/src/context-mode/web/fetcher.ts +31 -12
- package/src/debug/logger.ts +2 -1
- package/src/deps/registry.ts +1 -1
- package/src/discipline/failure-summarizer.ts +170 -0
- package/src/discipline/failure-taxonomy.ts +131 -0
- package/src/discipline/workflow-invariants.ts +125 -0
- package/src/discovery/index.ts +31 -0
- package/src/discovery/lsp.ts +87 -0
- package/src/discovery/rank.ts +144 -0
- package/src/discovery/sources.ts +89 -0
- package/src/discovery/workflow.ts +87 -0
- package/src/docs/contracts.ts +39 -0
- package/src/docs/drift.ts +117 -87
- package/src/fix-pr/assessment.ts +200 -0
- package/src/fix-pr/contracts.ts +47 -0
- package/src/fix-pr/fetch-comments.ts +80 -0
- package/src/fix-pr/prompt-builder.ts +58 -40
- package/src/fix-pr/scripts/exec.ts +34 -0
- package/src/fix-pr/scripts/trigger-review.ts +106 -0
- package/src/fix-pr/scripts/wait-and-check.ts +108 -0
- package/src/fix-pr/types.ts +4 -0
- package/src/git/branch-finish.ts +5 -0
- package/src/git/commit-contract.ts +83 -0
- package/src/git/commit.ts +121 -184
- package/src/git/status.ts +62 -8
- package/src/harness/anti_slop/architecture-parser.ts +210 -0
- package/src/harness/anti_slop/backend-factory.ts +30 -0
- package/src/harness/anti_slop/backend.ts +140 -0
- package/src/harness/anti_slop/desloppify-adapter.ts +319 -0
- package/src/harness/anti_slop/fallow-adapter.ts +305 -0
- package/src/harness/anti_slop/installer.ts +227 -0
- package/src/harness/anti_slop/queue.ts +216 -0
- package/src/harness/anti_slop/recommend.ts +84 -0
- package/src/harness/anti_slop/score.ts +180 -0
- package/src/harness/anti_slop/synthetic-edit-test.ts +128 -0
- package/src/harness/artifacts/agents-md.ts +88 -0
- package/src/harness/artifacts/checks-wiring.ts +57 -0
- package/src/harness/artifacts/docs-tree.ts +79 -0
- package/src/harness/artifacts/lint-configs.ts +136 -0
- package/src/harness/artifacts/review-agents.ts +67 -0
- package/src/harness/bare-entry.ts +108 -0
- package/src/harness/command.ts +1010 -0
- package/src/harness/default-agents/design.md +23 -0
- package/src/harness/default-agents/discover.md +18 -0
- package/src/harness/default-agents/implement.md +24 -0
- package/src/harness/default-agents/plan.md +19 -0
- package/src/harness/default-agents/research.md +21 -0
- package/src/harness/default-agents/validate.md +22 -0
- package/src/harness/gc/reporter.ts +28 -0
- package/src/harness/gc/runner.ts +136 -0
- package/src/harness/hooks/layer-context-inject.ts +155 -0
- package/src/harness/hooks/post-session-sweep.ts +130 -0
- package/src/harness/hooks/pre-edit-dupe-probe.ts +224 -0
- package/src/harness/hooks/register.ts +118 -0
- package/src/harness/model.ts +117 -0
- package/src/harness/pipeline.ts +348 -0
- package/src/harness/project-paths.ts +235 -0
- package/src/harness/stage-runner.ts +107 -0
- package/src/harness/stages/design.ts +386 -0
- package/src/harness/stages/discover.ts +454 -0
- package/src/harness/stages/implement.ts +162 -0
- package/src/harness/stages/plan.ts +335 -0
- package/src/harness/stages/research.ts +263 -0
- package/src/harness/stages/validate.ts +684 -0
- package/src/harness/storage.ts +467 -0
- package/src/harness/tools.ts +426 -0
- package/src/lsp/bridge.ts +56 -95
- package/src/lsp/capabilities.ts +108 -0
- package/src/lsp/contracts.ts +35 -0
- package/src/lsp/detector.ts +8 -12
- package/src/markdown-frontmatter.ts +68 -0
- package/src/mempalace/bridge.ts +135 -0
- package/src/mempalace/config.ts +75 -0
- package/src/mempalace/format.ts +163 -0
- package/src/mempalace/hooks.ts +370 -0
- package/src/mempalace/installer-helper.ts +194 -0
- package/src/mempalace/python/mempalace_bridge.py +440 -0
- package/src/mempalace/runtime.ts +565 -0
- package/src/mempalace/schema.ts +268 -0
- package/src/mempalace/session-summary.ts +198 -0
- package/src/mempalace/tool.ts +186 -0
- package/src/mempalace/uv.ts +256 -0
- package/src/migrate/runner.ts +354 -0
- package/src/planning/approval-flow.ts +206 -9
- package/src/planning/plan-writer-prompt.ts +4 -3
- package/src/planning/planning-ask-tool.ts +39 -0
- package/src/planning/render-markdown.ts +74 -0
- package/src/planning/spec.ts +42 -0
- package/src/planning/system-prompt.ts +11 -8
- package/src/planning/validate.ts +84 -0
- package/src/platform/omp.ts +15 -2
- package/src/platform/system-prompt.ts +37 -0
- package/src/platform/test-utils.ts +3 -0
- package/src/platform/types.ts +6 -1
- package/src/qa/config.ts +12 -6
- package/src/qa/detect-app-type.ts +13 -6
- package/src/qa/matrix.ts +12 -6
- package/src/qa/prompt-builder.ts +28 -30
- package/src/qa/scripts/dev-server-utils.ts +72 -0
- package/src/qa/scripts/run-e2e-tests.ts +226 -0
- package/src/qa/scripts/start-dev-server.ts +138 -0
- package/src/qa/scripts/stop-dev-server.ts +77 -0
- package/src/qa/session.ts +13 -7
- package/src/quality/ai-setup.ts +27 -25
- package/src/quality/contracts.ts +34 -0
- package/src/quality/gates/ai-review.ts +20 -58
- package/src/quality/gates/command.ts +249 -46
- package/src/quality/review-gates.ts +18 -2
- package/src/quality/runner.ts +63 -22
- package/src/quality/schemas.ts +37 -2
- package/src/quality/setup.ts +96 -16
- package/src/release/changelog.ts +1 -1
- package/src/release/channels/custom.ts +13 -3
- package/src/release/channels/types.ts +5 -0
- package/src/release/contracts.ts +90 -0
- package/src/release/executor.ts +122 -45
- package/src/release/prompt.ts +18 -2
- package/src/release/targets.ts +86 -0
- package/src/release/version.ts +96 -71
- package/src/review/agent-loader.ts +221 -109
- package/src/review/fixer.ts +10 -6
- package/src/review/multi-agent-runner.ts +114 -13
- package/src/review/output.ts +12 -139
- package/src/review/runner.ts +12 -6
- package/src/review/scope.ts +144 -24
- package/src/review/types.ts +1 -20
- package/src/review/validator.ts +12 -6
- package/src/storage/fix-pr-sessions.ts +21 -14
- package/src/storage/plans.ts +14 -5
- package/src/storage/qa-sessions.ts +25 -19
- package/src/storage/reliability-metrics.ts +180 -0
- package/src/storage/reports.ts +8 -7
- package/src/storage/review-sessions.ts +55 -20
- package/src/tool-catalog/active-tool-controller.ts +164 -0
- package/src/tool-catalog/active-tool-planner.ts +212 -0
- package/src/tool-catalog/tool-groups.ts +102 -0
- package/src/types.ts +1399 -5
- package/src/ui-design/backend-adapter.ts +78 -0
- package/src/ui-design/backends/local-html.ts +82 -0
- package/src/ui-design/backends/pencil-mcp.ts +111 -0
- package/src/ui-design/components-scanner.ts +124 -0
- package/src/ui-design/config.ts +55 -0
- package/src/ui-design/pen-scanner.ts +95 -0
- package/src/ui-design/pen-selector.ts +72 -0
- package/src/ui-design/prompt-builder.ts +73 -0
- package/src/ui-design/scanner.ts +136 -0
- package/src/ui-design/session.ts +974 -0
- package/src/ui-design/system-prompt.ts +312 -0
- package/src/ui-design/tokens-scanner.ts +181 -0
- package/src/ui-design/types.ts +96 -0
- package/src/ultraplan/agent-catalog.ts +522 -0
- package/src/ultraplan/authoring/agent-catalog.ts +310 -0
- package/src/ultraplan/authoring/authoring-tools.ts +552 -0
- package/src/ultraplan/authoring/command-handlers.ts +339 -0
- package/src/ultraplan/authoring/markdown.ts +510 -0
- package/src/ultraplan/authoring/model.ts +162 -0
- package/src/ultraplan/authoring/pipeline.ts +319 -0
- package/src/ultraplan/authoring/stage-runner.ts +141 -0
- package/src/ultraplan/authoring/stages/approve.ts +249 -0
- package/src/ultraplan/authoring/stages/discover.ts +289 -0
- package/src/ultraplan/authoring/stages/intake.ts +203 -0
- package/src/ultraplan/authoring/stages/research.ts +399 -0
- package/src/ultraplan/authoring/stages/review.ts +333 -0
- package/src/ultraplan/authoring/stages/scout.ts +188 -0
- package/src/ultraplan/authoring/stages/synthesize.ts +348 -0
- package/src/ultraplan/authoring/storage.ts +594 -0
- package/src/ultraplan/authoring/synth-gate.ts +165 -0
- package/src/ultraplan/authoring-draft.ts +653 -0
- package/src/ultraplan/authoring-persist.ts +180 -0
- package/src/ultraplan/authoring-tool.ts +608 -0
- package/src/ultraplan/authoring-wizard.ts +587 -0
- package/src/ultraplan/batch/merge.ts +98 -0
- package/src/ultraplan/batch/planner.ts +150 -0
- package/src/ultraplan/batch/presenter.ts +97 -0
- package/src/ultraplan/batch/storage.ts +420 -0
- package/src/ultraplan/batch/supervisor.ts +317 -0
- package/src/ultraplan/batch/worker.ts +26 -0
- package/src/ultraplan/batch/worktree.ts +110 -0
- package/src/ultraplan/contracts.ts +1593 -0
- package/src/ultraplan/default-agents/authoring/discoverer.md +12 -0
- package/src/ultraplan/default-agents/authoring/intake.md +12 -0
- package/src/ultraplan/default-agents/authoring/planner.md +12 -0
- package/src/ultraplan/default-agents/authoring/researcher.md +12 -0
- package/src/ultraplan/default-agents/authoring/scope-checker.md +12 -0
- package/src/ultraplan/default-agents/authoring/scout.md +12 -0
- package/src/ultraplan/default-agents/authoring/structure-checker.md +12 -0
- package/src/ultraplan/default-agents/authoring/tdd-checker.md +12 -0
- package/src/ultraplan/default-agents/backend-domain-reviewer.md +10 -0
- package/src/ultraplan/default-agents/backend-executor.md +10 -0
- package/src/ultraplan/default-agents/backend-stack-reviewer.md +10 -0
- package/src/ultraplan/default-agents/backend-tester.md +10 -0
- package/src/ultraplan/default-agents/frontend-domain-reviewer.md +10 -0
- package/src/ultraplan/default-agents/frontend-executor.md +10 -0
- package/src/ultraplan/default-agents/frontend-stack-reviewer.md +10 -0
- package/src/ultraplan/default-agents/frontend-tester.md +10 -0
- package/src/ultraplan/default-agents/infrastructure-domain-reviewer.md +10 -0
- package/src/ultraplan/default-agents/infrastructure-executor.md +10 -0
- package/src/ultraplan/default-agents/infrastructure-stack-reviewer.md +10 -0
- package/src/ultraplan/default-agents/infrastructure-tester.md +10 -0
- package/src/ultraplan/execution/contract.ts +71 -0
- package/src/ultraplan/execution/policy.ts +217 -0
- package/src/ultraplan/execution/runtime-tools.ts +107 -0
- package/src/ultraplan/execution/session-runner.ts +281 -0
- package/src/ultraplan/next-router.ts +85 -0
- package/src/ultraplan/presenter.ts +359 -0
- package/src/ultraplan/project-paths.ts +342 -0
- package/src/ultraplan/runtime/active-execution.ts +72 -0
- package/src/ultraplan/runtime/apply-mutation.ts +416 -0
- package/src/ultraplan/runtime/blockers.ts +243 -0
- package/src/ultraplan/runtime/hook-bridge.ts +486 -0
- package/src/ultraplan/runtime/launch-context.ts +207 -0
- package/src/ultraplan/runtime/migration.ts +524 -0
- package/src/ultraplan/runtime/normalize.ts +281 -0
- package/src/ultraplan/runtime/proof.ts +260 -0
- package/src/ultraplan/runtime/reducer.ts +416 -0
- package/src/ultraplan/runtime/repair.ts +251 -0
- package/src/ultraplan/runtime/tracker-storage.ts +368 -0
- package/src/ultraplan/session-selection.ts +291 -0
- package/src/ultraplan/storage.ts +374 -0
- package/src/utils/editor.ts +38 -0
- package/src/utils/executable.ts +80 -0
- package/src/utils/paths.ts +1 -20
- package/src/utils/shell.ts +31 -0
- package/src/visual/companion.ts +2 -1
- package/src/visual/scripts/frame-template.html +60 -0
- package/src/visual/scripts/index.js +59 -13
- package/src/visual/scripts/package.json +3 -0
- package/src/visual/start-server.ts +2 -1
- package/src/workspace/git-scope.ts +64 -0
- package/src/workspace/locks.ts +23 -0
- package/src/workspace/package-manager.ts +117 -0
- package/src/workspace/path-mapping.ts +75 -0
- package/src/workspace/project-slug.ts +92 -0
- package/src/workspace/repo-root.ts +137 -0
- package/src/workspace/selector.ts +115 -0
- package/src/workspace/state-paths.ts +118 -0
- package/src/workspace/targets.ts +313 -0
- package/src/fix-pr/scripts/diff-comments.sh +0 -33
- package/src/fix-pr/scripts/fetch-pr-comments.sh +0 -25
- package/src/fix-pr/scripts/trigger-review.sh +0 -36
- package/src/fix-pr/scripts/wait-and-check.sh +0 -37
- package/src/qa/scripts/detect-app-type.sh +0 -68
- package/src/qa/scripts/discover-routes.sh +0 -143
- package/src/qa/scripts/run-e2e-tests.sh +0 -131
- package/src/qa/scripts/start-dev-server.sh +0 -46
- package/src/qa/scripts/stop-dev-server.sh +0 -36
- package/src/review/prompts/fix-output-schema.md +0 -18
- package/src/review/prompts/review-output-schema.md +0 -38
- package/src/review/template.ts +0 -15
- /package/src/{review → ai}/prompts/invalid-output-retry.md +0 -0
package/src/types.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { TSchema } from "@sinclair/typebox";
|
|
2
2
|
import type { AgentSession, AgentSessionOptions, ExecOptions, ExecResult } from "./platform/types.js";
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
/** Generic schema-validation error produced by src/ai/structured-output.ts */
|
|
6
|
+
export interface ValidationError {
|
|
7
|
+
path: string;
|
|
8
|
+
message: string;
|
|
9
|
+
}
|
|
4
10
|
// src/types.ts — Shared type definitions for supipowers
|
|
5
11
|
|
|
6
12
|
/** Task complexity level */
|
|
@@ -42,7 +48,7 @@ export interface Notification {
|
|
|
42
48
|
export type CommandGateId = "lint" | "typecheck" | "format" | "test-suite" | "build";
|
|
43
49
|
export type GateId = "lsp-diagnostics" | CommandGateId;
|
|
44
50
|
|
|
45
|
-
export type ConfigScope = "
|
|
51
|
+
export type ConfigScope = "global" | "root";
|
|
46
52
|
|
|
47
53
|
/** Aggregate gate execution status */
|
|
48
54
|
export type GateStatus = "passed" | "failed" | "skipped" | "blocked";
|
|
@@ -175,6 +181,8 @@ export interface ReviewAgentConfig {
|
|
|
175
181
|
data: string;
|
|
176
182
|
model: string | null;
|
|
177
183
|
thinkingLevel: ThinkingLevel | null;
|
|
184
|
+
/** Opt this agent into IRC peer coordination (requires OMP `irc` tool active). */
|
|
185
|
+
peerCoordination?: boolean;
|
|
178
186
|
}
|
|
179
187
|
|
|
180
188
|
/** Top-level review agent pipeline config */
|
|
@@ -196,7 +204,9 @@ export interface ConfiguredReviewAgent extends ReviewAgentDefinition {
|
|
|
196
204
|
data: string;
|
|
197
205
|
model: string | null;
|
|
198
206
|
thinkingLevel: ThinkingLevel | null;
|
|
199
|
-
|
|
207
|
+
/** Opt this agent into IRC peer coordination (requires OMP `irc` tool active). */
|
|
208
|
+
peerCoordination?: boolean;
|
|
209
|
+
scope?: "global" | "root" | "workspace";
|
|
200
210
|
}
|
|
201
211
|
|
|
202
212
|
|
|
@@ -265,10 +275,22 @@ export interface LspDiagnosticsGateConfig {
|
|
|
265
275
|
enabled: boolean;
|
|
266
276
|
}
|
|
267
277
|
|
|
278
|
+
/** Canonical target selectors for command-driven quality-gate runs. */
|
|
279
|
+
export type CommandGateRunTarget =
|
|
280
|
+
| { scope: "all-targets" }
|
|
281
|
+
| { scope: "root" }
|
|
282
|
+
| { scope: "all-workspaces" }
|
|
283
|
+
| { scope: "workspace"; relativeDir: string };
|
|
284
|
+
|
|
285
|
+
export interface CommandGateRun {
|
|
286
|
+
command: string;
|
|
287
|
+
target: CommandGateRunTarget;
|
|
288
|
+
}
|
|
289
|
+
|
|
268
290
|
/** Shared config for command-driven gates. */
|
|
269
291
|
export type CommandGateConfig =
|
|
270
|
-
| { enabled: false
|
|
271
|
-
| { enabled: true;
|
|
292
|
+
| { enabled: false }
|
|
293
|
+
| { enabled: true; runs: CommandGateRun[] };
|
|
272
294
|
|
|
273
295
|
export type LintGateConfig = CommandGateConfig;
|
|
274
296
|
export type TypecheckGateConfig = CommandGateConfig;
|
|
@@ -292,13 +314,24 @@ export interface GateFilters {
|
|
|
292
314
|
skip?: GateId[];
|
|
293
315
|
}
|
|
294
316
|
|
|
317
|
+
/** Per-target facts used by monorepo-aware gate setup/detection */
|
|
318
|
+
export interface ProjectFactsTarget {
|
|
319
|
+
name: string;
|
|
320
|
+
kind: WorkspaceTargetKind;
|
|
321
|
+
relativeDir: string;
|
|
322
|
+
packageScripts: Record<string, string>;
|
|
323
|
+
}
|
|
324
|
+
|
|
295
325
|
/** Project facts used by gate setup/detection */
|
|
296
326
|
export interface ProjectFacts {
|
|
297
327
|
cwd: string;
|
|
328
|
+
/** Scripts that are shared across every discovered target and are safe baseline candidates. */
|
|
298
329
|
packageScripts: Record<string, string>;
|
|
299
330
|
lockfiles: string[];
|
|
300
331
|
activeTools: string[];
|
|
301
332
|
existingGates: QualityGatesConfig;
|
|
333
|
+
/** Detailed per-target scripts for AI-assisted setup in monorepos. */
|
|
334
|
+
targets: ProjectFactsTarget[];
|
|
302
335
|
}
|
|
303
336
|
|
|
304
337
|
/** Recommendation returned by gate auto-detection */
|
|
@@ -314,6 +347,7 @@ export interface GateExecutionContext {
|
|
|
314
347
|
changedFiles: string[];
|
|
315
348
|
scopeFiles: string[];
|
|
316
349
|
fileScope: "changed-files" | "all-files";
|
|
350
|
+
target: WorkspaceTarget;
|
|
317
351
|
exec: (cmd: string, args: string[], opts?: ExecOptions) => Promise<ExecResult>;
|
|
318
352
|
execShell: (command: string, opts?: ExecOptions) => Promise<ExecResult>;
|
|
319
353
|
getLspDiagnostics: (
|
|
@@ -321,7 +355,7 @@ export interface GateExecutionContext {
|
|
|
321
355
|
fileScope: GateExecutionContext["fileScope"]
|
|
322
356
|
) => Promise<GateIssue[]>;
|
|
323
357
|
createAgentSession: (
|
|
324
|
-
opts: Pick<AgentSessionOptions, "cwd" | "model" | "thinkingLevel">
|
|
358
|
+
opts: Pick<AgentSessionOptions, "cwd" | "model" | "thinkingLevel" | "agentId" | "agentDisplayName">
|
|
325
359
|
) => Promise<AgentSession>;
|
|
326
360
|
activeTools: string[];
|
|
327
361
|
reviewModel?: Pick<ResolvedModel, "model" | "thinkingLevel">;
|
|
@@ -339,6 +373,7 @@ export interface GateDefinition<TConfig> {
|
|
|
339
373
|
/** A proposed quality-gate configuration */
|
|
340
374
|
export interface SetupProposal {
|
|
341
375
|
gates: QualityGatesConfig;
|
|
376
|
+
notes?: string[];
|
|
342
377
|
}
|
|
343
378
|
|
|
344
379
|
/** Result of running the setup flow */
|
|
@@ -355,6 +390,32 @@ export type BumpType = "major" | "minor" | "patch";
|
|
|
355
390
|
/** Release channel target (built-in IDs or user-defined custom channel IDs) */
|
|
356
391
|
export type ReleaseChannel = string;
|
|
357
392
|
|
|
393
|
+
/** Supported package managers for workspace-aware execution */
|
|
394
|
+
export type PackageManagerId = "bun" | "npm" | "pnpm" | "yarn";
|
|
395
|
+
|
|
396
|
+
/** Workspace target kind */
|
|
397
|
+
export type WorkspaceTargetKind = "root" | "workspace";
|
|
398
|
+
|
|
399
|
+
/** One package target discovered in the current repository */
|
|
400
|
+
export interface WorkspaceTarget {
|
|
401
|
+
id: string;
|
|
402
|
+
name: string;
|
|
403
|
+
kind: WorkspaceTargetKind;
|
|
404
|
+
repoRoot: string;
|
|
405
|
+
packageDir: string;
|
|
406
|
+
manifestPath: string;
|
|
407
|
+
relativeDir: string;
|
|
408
|
+
version: string;
|
|
409
|
+
private: boolean;
|
|
410
|
+
packageManager: PackageManagerId;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** One releasable package discovered in the current repository */
|
|
414
|
+
export interface ReleaseTarget extends WorkspaceTarget {
|
|
415
|
+
publishScopePaths: string[];
|
|
416
|
+
defaultTagFormat: string;
|
|
417
|
+
}
|
|
418
|
+
|
|
358
419
|
/** User-defined custom release channel configuration */
|
|
359
420
|
export interface CustomChannelConfig {
|
|
360
421
|
/** Display name shown in the channel selection UI */
|
|
@@ -394,6 +455,64 @@ export interface ReleaseResult {
|
|
|
394
455
|
error?: string;
|
|
395
456
|
}
|
|
396
457
|
|
|
458
|
+
export type ContextModeProcessorFamily =
|
|
459
|
+
| "git"
|
|
460
|
+
| "test"
|
|
461
|
+
| "lint"
|
|
462
|
+
| "build"
|
|
463
|
+
| "k8s"
|
|
464
|
+
| "docker"
|
|
465
|
+
| "log"
|
|
466
|
+
| "json";
|
|
467
|
+
|
|
468
|
+
export interface ContextModeProcessorsConfig {
|
|
469
|
+
enabled: boolean;
|
|
470
|
+
disable: ContextModeProcessorFamily[];
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export type ContextModeLazyToolsMode = "conservative" | "balanced" | "aggressive";
|
|
474
|
+
|
|
475
|
+
export interface ContextModeLazyToolsConfig {
|
|
476
|
+
enabled: boolean;
|
|
477
|
+
mode: ContextModeLazyToolsMode;
|
|
478
|
+
alwaysKeep: string[];
|
|
479
|
+
commandAllowlist: Record<string, string[]>;
|
|
480
|
+
keywordTools: Record<string, string[]>;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export type KnowledgeOwnerScope = "session" | "project" | "legacy";
|
|
484
|
+
|
|
485
|
+
export interface KnowledgeOwner {
|
|
486
|
+
ownerScope: KnowledgeOwnerScope;
|
|
487
|
+
ownerId?: string;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export interface ContextModeCacheHandlesConfig {
|
|
491
|
+
enabled: boolean;
|
|
492
|
+
spillThresholdBytes: number;
|
|
493
|
+
previewBytes: number;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export interface ContextModeRepomapConfig {
|
|
497
|
+
enabled: boolean;
|
|
498
|
+
tokenBudget: number;
|
|
499
|
+
maxFiles: number;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export interface ContextModeMemoryConfig {
|
|
503
|
+
enabled: boolean;
|
|
504
|
+
byteBudget: number;
|
|
505
|
+
maxRows: number;
|
|
506
|
+
retentionDays: number;
|
|
507
|
+
/**
|
|
508
|
+
* Cadence at which the focus-chain block is reinjected into the system
|
|
509
|
+
* prompt at `before_agent_start`. Turn 1 always injects; subsequent turns
|
|
510
|
+
* inject only when `turnCount % focusChainCadence === 0`. Default 6
|
|
511
|
+
* (matches Cline v3.25). Must be >= 1.
|
|
512
|
+
*/
|
|
513
|
+
focusChainCadence: number;
|
|
514
|
+
}
|
|
515
|
+
|
|
397
516
|
/** Context-mode integration settings */
|
|
398
517
|
export interface ContextModeConfig {
|
|
399
518
|
/** Master toggle for all supi-context-mode integration (default: true) */
|
|
@@ -414,6 +533,16 @@ export interface ContextModeConfig {
|
|
|
414
533
|
llmThreshold: number;
|
|
415
534
|
/** Hard-block native search/read tools when ctx_* equivalents are available (default: true) */
|
|
416
535
|
enforceRouting: boolean;
|
|
536
|
+
/** Deterministic content-aware emission processors (default: enabled with no disabled families) */
|
|
537
|
+
processors: ContextModeProcessorsConfig;
|
|
538
|
+
/** Lazy active-tool filtering policy for supipowers-owned tools (default: balanced) */
|
|
539
|
+
lazyTools: ContextModeLazyToolsConfig;
|
|
540
|
+
/** Cache-handle spill policy for oversized current tool results (default: enabled at 50KiB) */
|
|
541
|
+
cacheHandles: ContextModeCacheHandlesConfig;
|
|
542
|
+
/** Repo-map retrieval policy for ctx_repomap */
|
|
543
|
+
repomap: ContextModeRepomapConfig;
|
|
544
|
+
/** Cross-session memory injection policy */
|
|
545
|
+
memory: ContextModeMemoryConfig;
|
|
417
546
|
}
|
|
418
547
|
|
|
419
548
|
/** MCP management settings */
|
|
@@ -422,6 +551,54 @@ export interface McpManagementConfig {
|
|
|
422
551
|
closeSessionsOnExit: boolean;
|
|
423
552
|
}
|
|
424
553
|
|
|
554
|
+
/** MemPalace native integration default wing derivation mode */
|
|
555
|
+
export type MempalaceWingStrategy = "repo-name" | "project-slug" | "explicit";
|
|
556
|
+
|
|
557
|
+
/** MemPalace native integration settings */
|
|
558
|
+
export interface MempalaceConfig {
|
|
559
|
+
/** Enable native MemPalace memory integration */
|
|
560
|
+
enabled: boolean;
|
|
561
|
+
/** Exact PyPI package version installed by managed setup */
|
|
562
|
+
packageVersion: string;
|
|
563
|
+
/** Managed Python virtual environment path; supports ~ expansion */
|
|
564
|
+
managedVenvPath: string;
|
|
565
|
+
/** MemPalace palace path; supports ~ expansion */
|
|
566
|
+
palacePath: string;
|
|
567
|
+
/** How to derive the default project wing */
|
|
568
|
+
defaultWingStrategy: MempalaceWingStrategy;
|
|
569
|
+
/** Required non-empty wing when defaultWingStrategy is explicit */
|
|
570
|
+
explicitWing: string | null;
|
|
571
|
+
/** Agent name used for diary/checkpoint metadata */
|
|
572
|
+
defaultAgentName: string;
|
|
573
|
+
/** Permit explicit tool calls to setup automatically before dispatch */
|
|
574
|
+
autoSetup: boolean;
|
|
575
|
+
hooks: {
|
|
576
|
+
wakeUp: boolean;
|
|
577
|
+
searchGuidance: boolean;
|
|
578
|
+
autoSearchOnPrompt: boolean;
|
|
579
|
+
compactionCheckpoint: boolean;
|
|
580
|
+
shutdownDiary: boolean;
|
|
581
|
+
};
|
|
582
|
+
budgets: {
|
|
583
|
+
wakeUpTokens: number;
|
|
584
|
+
searchResultChars: number;
|
|
585
|
+
listResultChars: number;
|
|
586
|
+
diaryChars: number;
|
|
587
|
+
autoSearchTokens: number;
|
|
588
|
+
/**
|
|
589
|
+
* Re-inject the full wake-up block every Nth turn. Other turns get a
|
|
590
|
+
* one-line refresher instead. `1` = always inject (legacy behavior).
|
|
591
|
+
*/
|
|
592
|
+
wakeUpInjectionEvery: number;
|
|
593
|
+
};
|
|
594
|
+
timeouts: {
|
|
595
|
+
setupMs: number;
|
|
596
|
+
bridgeMs: number;
|
|
597
|
+
hookMs: number;
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
|
|
425
602
|
/** Thinking level for model configuration */
|
|
426
603
|
export type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
427
604
|
|
|
@@ -486,8 +663,10 @@ export interface SupipowersConfig {
|
|
|
486
663
|
/** User-defined custom release channels keyed by channel ID */
|
|
487
664
|
customChannels: Record<string, CustomChannelConfig>;
|
|
488
665
|
};
|
|
666
|
+
ultraplan: UltraPlanConfig;
|
|
489
667
|
contextMode: ContextModeConfig;
|
|
490
668
|
mcp: McpManagementConfig;
|
|
669
|
+
mempalace: MempalaceConfig;
|
|
491
670
|
}
|
|
492
671
|
|
|
493
672
|
|
|
@@ -511,4 +690,1219 @@ export interface DriftCheckResult {
|
|
|
511
690
|
drifted: boolean;
|
|
512
691
|
summary: string;
|
|
513
692
|
findings: DriftFinding[];
|
|
693
|
+
/** Error messages from sub-agents whose output failed schema validation after retries. */
|
|
694
|
+
errors?: string[];
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// ---------------------------------------------------------------------------
|
|
698
|
+
// Reliability metrics (Phase 8 — observability + failure mining)
|
|
699
|
+
// ---------------------------------------------------------------------------
|
|
700
|
+
|
|
701
|
+
/** Outcome categories for AI-heavy command attempts. */
|
|
702
|
+
export type ReliabilityOutcome = "ok" | "blocked" | "retry-exhausted" | "fallback" | "agent-error";
|
|
703
|
+
|
|
704
|
+
/** A single recorded outcome from an AI-heavy workflow attempt. */
|
|
705
|
+
export interface ReliabilityRecord {
|
|
706
|
+
/** ISO timestamp the attempt completed. */
|
|
707
|
+
ts: string;
|
|
708
|
+
/** Logical command name (e.g. "plan", "commit", "review", "fix-pr", "release"). */
|
|
709
|
+
command: string;
|
|
710
|
+
/** Specific operation within the command (e.g. "plan-spec", "commit-plan", "polish"). Optional. */
|
|
711
|
+
operation?: string;
|
|
712
|
+
/** Final outcome category. */
|
|
713
|
+
outcome: ReliabilityOutcome;
|
|
714
|
+
/** Number of attempts the underlying retry loop performed. */
|
|
715
|
+
attempts: number;
|
|
716
|
+
/** Short truthful reason on blocked/error outcomes. Optional on success. */
|
|
717
|
+
reason?: string;
|
|
718
|
+
/** Optional cwd where the attempt ran. */
|
|
719
|
+
cwd?: string;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/** Aggregated summary of reliability records, suitable for status/doctor output. */
|
|
723
|
+
export interface ReliabilitySummary {
|
|
724
|
+
command: string;
|
|
725
|
+
total: number;
|
|
726
|
+
/** Count by outcome category. */
|
|
727
|
+
byOutcome: Record<ReliabilityOutcome, number>;
|
|
728
|
+
/** Average attempts across all records (0 when total is 0). */
|
|
729
|
+
avgAttempts: number;
|
|
730
|
+
/** Most recent record timestamp, or null when empty. */
|
|
731
|
+
lastRecordedAt: string | null;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// ---------------------------------------------------------------------------
|
|
735
|
+
// Ultraplan (Phase 1 substrate)
|
|
736
|
+
// ---------------------------------------------------------------------------
|
|
737
|
+
|
|
738
|
+
export type UltraPlanStackId = "frontend" | "backend" | "infrastructure";
|
|
739
|
+
export type UltraPlanScenarioLevel = "unit" | "integration" | "e2e";
|
|
740
|
+
export type UltraPlanApplicability = "applicable" | "not-applicable";
|
|
741
|
+
export type UltraPlanSessionState = "ready" | "running" | "blocked" | "awaiting-user" | "complete" | "discarded";
|
|
742
|
+
export type UltraPlanSessionBucket = "pending" | "ongoing" | "idle" | "done";
|
|
743
|
+
export type UltraPlanScenarioStatus =
|
|
744
|
+
| "planned"
|
|
745
|
+
| "red-running"
|
|
746
|
+
| "red-proved"
|
|
747
|
+
| "green-running"
|
|
748
|
+
| "green-proved"
|
|
749
|
+
| "in-review"
|
|
750
|
+
| "review-passed"
|
|
751
|
+
| "blocked"
|
|
752
|
+
| "done";
|
|
753
|
+
export type UltraPlanReviewStatus = "pending" | "running" | "passed" | "failed" | "blocked";
|
|
754
|
+
export type UltraPlanExecutionPhase = "red" | "green" | "review" | "waiting" | "complete";
|
|
755
|
+
export type UltraPlanCursorTargetType = "scenario" | "domain-review" | "stack-review" | "session";
|
|
756
|
+
export type UltraPlanCursorStatus = UltraPlanScenarioStatus | UltraPlanReviewStatus | UltraPlanSessionState;
|
|
757
|
+
export type UltraPlanAgentType = "built-in" | "named";
|
|
758
|
+
export type UltraPlanAgentSlotName =
|
|
759
|
+
| "frontend-executor"
|
|
760
|
+
| "frontend-tester"
|
|
761
|
+
| "frontend-domain-reviewer"
|
|
762
|
+
| "frontend-stack-reviewer"
|
|
763
|
+
| "backend-executor"
|
|
764
|
+
| "backend-tester"
|
|
765
|
+
| "backend-domain-reviewer"
|
|
766
|
+
| "backend-stack-reviewer"
|
|
767
|
+
| "infrastructure-executor"
|
|
768
|
+
| "infrastructure-tester"
|
|
769
|
+
| "infrastructure-domain-reviewer"
|
|
770
|
+
| "infrastructure-stack-reviewer";
|
|
771
|
+
export type UltraPlanReviewerSlotName = Extract<
|
|
772
|
+
UltraPlanAgentSlotName,
|
|
773
|
+
`${UltraPlanStackId}-domain-reviewer` | `${UltraPlanStackId}-stack-reviewer`
|
|
774
|
+
>;
|
|
775
|
+
export type UltraPlanSlotOverride = {
|
|
776
|
+
agentName?: string;
|
|
777
|
+
model?: string;
|
|
778
|
+
thinkingLevel?: ThinkingLevel;
|
|
779
|
+
};
|
|
780
|
+
export interface UltraPlanReviewGatePolicy {
|
|
781
|
+
enabled: boolean;
|
|
782
|
+
}
|
|
783
|
+
export interface UltraPlanConfig {
|
|
784
|
+
slots: Partial<Record<UltraPlanAgentSlotName, UltraPlanSlotOverride>>;
|
|
785
|
+
reviewGates: Partial<Record<UltraPlanReviewerSlotName, UltraPlanReviewGatePolicy>>;
|
|
786
|
+
}
|
|
787
|
+
export interface UltraPlanAgentDefinitionFrontmatter {
|
|
788
|
+
name: string;
|
|
789
|
+
description: string;
|
|
790
|
+
supportedSlots: UltraPlanAgentSlotName[];
|
|
791
|
+
model?: string;
|
|
792
|
+
thinkingLevel?: ThinkingLevel;
|
|
793
|
+
focus?: string;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
export type UltraPlanAgentDefinitionSource = "built-in" | "global";
|
|
797
|
+
export interface UltraPlanAgentDefinition extends UltraPlanAgentDefinitionFrontmatter {
|
|
798
|
+
prompt: string;
|
|
799
|
+
filePath: string;
|
|
800
|
+
source: UltraPlanAgentDefinitionSource;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
export type UltraPlanSelectionSource = "default" | "project";
|
|
804
|
+
export type UltraPlanResolvedValueSource = "project" | "global" | "built-in" | "unset";
|
|
805
|
+
export interface ResolvedUltraPlanSlotBinding {
|
|
806
|
+
slot: UltraPlanAgentSlotName;
|
|
807
|
+
agentType: UltraPlanAgentType;
|
|
808
|
+
agentName: string;
|
|
809
|
+
model: string | null;
|
|
810
|
+
thinkingLevel: ThinkingLevel | null;
|
|
811
|
+
selectionSource: UltraPlanSelectionSource;
|
|
812
|
+
definitionSource: UltraPlanAgentDefinitionSource;
|
|
813
|
+
modelSource: UltraPlanResolvedValueSource;
|
|
814
|
+
thinkingLevelSource: UltraPlanResolvedValueSource;
|
|
815
|
+
definitionPath: string | null;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
export interface ResolvedUltraPlanCatalog {
|
|
819
|
+
slots: Record<UltraPlanAgentSlotName, ResolvedUltraPlanSlotBinding | null>;
|
|
820
|
+
reviewGates: Partial<Record<UltraPlanReviewerSlotName, UltraPlanReviewGatePolicy>>;
|
|
821
|
+
}
|
|
822
|
+
export type UltraPlanCatalogErrorCode =
|
|
823
|
+
| "missing-built-in-definition"
|
|
824
|
+
| "required-slot-unresolved"
|
|
825
|
+
| "unsupported-slot"
|
|
826
|
+
| "invalid-agent-definition"
|
|
827
|
+
| "duplicate-agent-name"
|
|
828
|
+
| "reserved-agent-name"
|
|
829
|
+
| "invalid-config"
|
|
830
|
+
| "catalog-io";
|
|
831
|
+
|
|
832
|
+
export interface UltraPlanCatalogError {
|
|
833
|
+
slot: UltraPlanAgentSlotName | null;
|
|
834
|
+
code: UltraPlanCatalogErrorCode;
|
|
835
|
+
message: string;
|
|
836
|
+
path: string | null;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
export type UltraPlanCatalogLoadResult =
|
|
840
|
+
| { ok: true; value: ResolvedUltraPlanCatalog }
|
|
841
|
+
| { ok: false; value: ResolvedUltraPlanCatalog; errors: UltraPlanCatalogError[] };
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
export type UltraPlanProofType = "test" | "command" | "review" | "artifact";
|
|
847
|
+
export type UltraPlanBlockerScope = "session" | "stack" | "domain" | "scenario";
|
|
848
|
+
export type UltraPlanRecoveryMode = "retry" | "await-user" | "manual";
|
|
849
|
+
|
|
850
|
+
export interface UltraPlanProgressSummary {
|
|
851
|
+
total: number;
|
|
852
|
+
terminal: number;
|
|
853
|
+
blocked: number;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
export interface UltraPlanAffectedUnitRef {
|
|
857
|
+
stack: UltraPlanStackId | null;
|
|
858
|
+
domainId: string | null;
|
|
859
|
+
level: UltraPlanScenarioLevel | null;
|
|
860
|
+
scenarioId: string | null;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export interface UltraPlanProofEvidence {
|
|
864
|
+
summary: string;
|
|
865
|
+
command?: string;
|
|
866
|
+
outputRef?: string;
|
|
867
|
+
metadata?: Record<string, unknown>;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
export interface UltraPlanProof {
|
|
871
|
+
type: UltraPlanProofType;
|
|
872
|
+
phase: UltraPlanExecutionPhase;
|
|
873
|
+
recordedAt: string;
|
|
874
|
+
actor: string;
|
|
875
|
+
evidence: UltraPlanProofEvidence;
|
|
876
|
+
artifactRef: string;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
export interface UltraPlanBlocker {
|
|
880
|
+
code: string;
|
|
881
|
+
message: string;
|
|
882
|
+
scope: UltraPlanBlockerScope;
|
|
883
|
+
affected: UltraPlanAffectedUnitRef;
|
|
884
|
+
recoverable: boolean;
|
|
885
|
+
recoveryMode: UltraPlanRecoveryMode;
|
|
886
|
+
nextAction: string;
|
|
887
|
+
retryable: boolean;
|
|
888
|
+
detectedAt: string;
|
|
889
|
+
details?: Record<string, unknown>;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
export interface UltraPlanAgentBinding {
|
|
893
|
+
slot: UltraPlanAgentSlotName;
|
|
894
|
+
agentType: UltraPlanAgentType;
|
|
895
|
+
agentName: string;
|
|
896
|
+
model: string | null;
|
|
897
|
+
thinkingLevel: ThinkingLevel | null;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
export interface UltraPlanAgentSlots {
|
|
901
|
+
executor: UltraPlanAgentBinding;
|
|
902
|
+
tester: UltraPlanAgentBinding;
|
|
903
|
+
domainReviewEnabled: boolean;
|
|
904
|
+
stackReviewEnabled: boolean;
|
|
905
|
+
domainReviewer?: UltraPlanAgentBinding;
|
|
906
|
+
stackReviewer?: UltraPlanAgentBinding;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
export interface UltraPlanScenario {
|
|
910
|
+
id: string;
|
|
911
|
+
title: string;
|
|
912
|
+
stack: UltraPlanStackId;
|
|
913
|
+
domainId: string;
|
|
914
|
+
level: UltraPlanScenarioLevel;
|
|
915
|
+
status: UltraPlanScenarioStatus;
|
|
916
|
+
steps: string[];
|
|
917
|
+
assignedSlots: UltraPlanAgentSlotName[];
|
|
918
|
+
proofs: UltraPlanProof[];
|
|
919
|
+
dependencies?: string[];
|
|
920
|
+
blocker?: UltraPlanBlocker | null;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
export interface UltraPlanDomainReviewGate {
|
|
924
|
+
enabled: boolean;
|
|
925
|
+
status: UltraPlanReviewStatus;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
export interface UltraPlanDomain {
|
|
929
|
+
id: string;
|
|
930
|
+
name: string;
|
|
931
|
+
unit: UltraPlanScenario[];
|
|
932
|
+
integration: UltraPlanScenario[];
|
|
933
|
+
e2e: UltraPlanScenario[];
|
|
934
|
+
review: UltraPlanDomainReviewGate;
|
|
935
|
+
progress: UltraPlanProgressSummary;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export interface UltraPlanStack {
|
|
939
|
+
stack: UltraPlanStackId;
|
|
940
|
+
applicability: UltraPlanApplicability;
|
|
941
|
+
domains: UltraPlanDomain[];
|
|
942
|
+
status: UltraPlanSessionState;
|
|
943
|
+
agentSlots: UltraPlanAgentSlots;
|
|
944
|
+
progress: UltraPlanProgressSummary;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
export interface UltraPlanCursor {
|
|
948
|
+
targetType: UltraPlanCursorTargetType;
|
|
949
|
+
stack: UltraPlanStackId | null;
|
|
950
|
+
domainId: string | null;
|
|
951
|
+
level: UltraPlanScenarioLevel | null;
|
|
952
|
+
scenarioId: string | null;
|
|
953
|
+
phase: UltraPlanExecutionPhase;
|
|
954
|
+
status: UltraPlanCursorStatus;
|
|
955
|
+
summary: string;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
export interface UltraPlanDomainReview {
|
|
959
|
+
stack: UltraPlanStackId;
|
|
960
|
+
domainId: string;
|
|
961
|
+
reviewerSlot: UltraPlanAgentSlotName;
|
|
962
|
+
status: UltraPlanReviewStatus;
|
|
963
|
+
startedAt: string;
|
|
964
|
+
completedAt?: string;
|
|
965
|
+
summary: string;
|
|
966
|
+
artifactRef: string;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
export interface UltraPlanStackReview {
|
|
970
|
+
stack: UltraPlanStackId;
|
|
971
|
+
reviewerSlot: UltraPlanAgentSlotName;
|
|
972
|
+
status: UltraPlanReviewStatus;
|
|
973
|
+
startedAt: string;
|
|
974
|
+
completedAt?: string;
|
|
975
|
+
summary: string;
|
|
976
|
+
artifactRef: string;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
export interface UltraPlanAuthoredArtifact {
|
|
980
|
+
sessionId: string;
|
|
981
|
+
title: string;
|
|
982
|
+
goal: string;
|
|
983
|
+
createdAt: string;
|
|
984
|
+
updatedAt: string;
|
|
985
|
+
stacks: UltraPlanStack[];
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
export interface UltraPlanManifestAuthoredRefs {
|
|
989
|
+
json: string;
|
|
990
|
+
markdown?: string;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
export interface UltraPlanManifestStackSummary {
|
|
994
|
+
stack: UltraPlanStackId;
|
|
995
|
+
applicability: UltraPlanApplicability;
|
|
996
|
+
progress: UltraPlanProgressSummary;
|
|
997
|
+
domainCount: number;
|
|
998
|
+
terminalDomainCount: number;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
export interface UltraPlanManifestReviewReference {
|
|
1002
|
+
type: "domain" | "stack";
|
|
1003
|
+
stack: UltraPlanStackId;
|
|
1004
|
+
domainId: string | null;
|
|
1005
|
+
path: string;
|
|
1006
|
+
status: UltraPlanReviewStatus;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
export interface UltraPlanManifest {
|
|
1010
|
+
sessionId: string;
|
|
1011
|
+
projectName: string;
|
|
1012
|
+
title: string;
|
|
1013
|
+
authored: UltraPlanManifestAuthoredRefs;
|
|
1014
|
+
state: UltraPlanSessionState;
|
|
1015
|
+
cursor: UltraPlanCursor | null;
|
|
1016
|
+
lastCompleted: UltraPlanCursor | null;
|
|
1017
|
+
progress: UltraPlanProgressSummary;
|
|
1018
|
+
stacks: UltraPlanManifestStackSummary[];
|
|
1019
|
+
blocker: UltraPlanBlocker | null;
|
|
1020
|
+
reviews: UltraPlanManifestReviewReference[];
|
|
1021
|
+
createdAt: string;
|
|
1022
|
+
updatedAt: string;
|
|
1023
|
+
/**
|
|
1024
|
+
* Multi-stage authoring pipeline state. Present only while a session is being authored
|
|
1025
|
+
* via the GSD-style pipeline (stage "approved" or transitioned to `state: "ready"` via the
|
|
1026
|
+
* legacy single-shot `ultraplan_create` tool leaves this field absent).
|
|
1027
|
+
*
|
|
1028
|
+
* Existing manifests written before the multi-stage pipeline shipped will not have this
|
|
1029
|
+
* field, and the schema treats it as optional.
|
|
1030
|
+
*/
|
|
1031
|
+
authoring?: UltraPlanAuthoringState;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
export interface UltraPlanIndexEntry {
|
|
1035
|
+
sessionId: string;
|
|
1036
|
+
title: string;
|
|
1037
|
+
state: UltraPlanSessionState;
|
|
1038
|
+
bucket: UltraPlanSessionBucket;
|
|
1039
|
+
createdAt: string;
|
|
1040
|
+
updatedAt: string;
|
|
1041
|
+
cursor: UltraPlanCursor | null;
|
|
1042
|
+
idleReason: string | null;
|
|
1043
|
+
/**
|
|
1044
|
+
* Authoring stage for sessions that are still in the multi-stage pipeline. Optional —
|
|
1045
|
+
* absent for sessions authored via the legacy `ultraplan_create` path or for sessions
|
|
1046
|
+
* already promoted to `state: "ready"`. Used by the picker to surface in-flight authoring
|
|
1047
|
+
* sessions ahead of executable ones.
|
|
1048
|
+
*/
|
|
1049
|
+
authoringStage?: UltraPlanAuthoringStage | null;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
export interface UltraPlanIndex {
|
|
1053
|
+
sessions: UltraPlanIndexEntry[];
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
export interface UltraPlanStorageError {
|
|
1057
|
+
kind: "missing" | "invalid-json" | "validation-error" | "io";
|
|
1058
|
+
path: string;
|
|
1059
|
+
message: string;
|
|
1060
|
+
details?: string[];
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
export type UltraPlanStorageResult<T> =
|
|
1064
|
+
| { ok: true; value: T }
|
|
1065
|
+
| { ok: false; error: UltraPlanStorageError };
|
|
1066
|
+
|
|
1067
|
+
export interface UltraPlanSessionSummary {
|
|
1068
|
+
sessionId: string;
|
|
1069
|
+
projectName: string;
|
|
1070
|
+
title: string;
|
|
1071
|
+
state: UltraPlanSessionState;
|
|
1072
|
+
createdAt: string;
|
|
1073
|
+
updatedAt: string;
|
|
1074
|
+
cursor: UltraPlanCursor | null;
|
|
1075
|
+
lastCompleted: UltraPlanCursor | null;
|
|
1076
|
+
blocker: UltraPlanBlocker | null;
|
|
1077
|
+
progress: UltraPlanProgressSummary;
|
|
1078
|
+
stacks: UltraPlanManifestStackSummary[];
|
|
1079
|
+
reviews: UltraPlanManifestReviewReference[];
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
// ---------------------------------------------------------------------------
|
|
1083
|
+
// UltraPlan multi-stage authoring pipeline (GSD-style)
|
|
1084
|
+
//
|
|
1085
|
+
// These types describe the state captured under `<session>/authoring/` while a
|
|
1086
|
+
// new session is being shaped through the intake \u2192 scout \u2192 discover \u2192 research \u2192
|
|
1087
|
+
// synthesize \u2192 review \u2192 approve pipeline. Once a session is approved, the
|
|
1088
|
+
// manifest's top-level `state` flips to "ready" and the runtime treats the session
|
|
1089
|
+
// as ordinary.
|
|
1090
|
+
// ---------------------------------------------------------------------------
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* Pipeline stage identifier. The order is meaningful \u2014 stages execute strictly in this
|
|
1094
|
+
* sequence and the reducer only ever advances one step at a time.
|
|
1095
|
+
*
|
|
1096
|
+
* `revise` is a sub-stage of review that re-spawns the planner with consolidated findings;
|
|
1097
|
+
* its presence is signalled by `iteration > 1`, not by a distinct stage transition.
|
|
1098
|
+
*/
|
|
1099
|
+
export type UltraPlanAuthoringStage =
|
|
1100
|
+
| "intake"
|
|
1101
|
+
| "scout"
|
|
1102
|
+
| "discover"
|
|
1103
|
+
| "research"
|
|
1104
|
+
| "synthesize"
|
|
1105
|
+
| "review"
|
|
1106
|
+
| "approve";
|
|
1107
|
+
|
|
1108
|
+
/** Operational status of the current stage. */
|
|
1109
|
+
export type UltraPlanAuthoringStageStatus =
|
|
1110
|
+
| "pending"
|
|
1111
|
+
| "running"
|
|
1112
|
+
| "blocked"
|
|
1113
|
+
| "awaiting-user"
|
|
1114
|
+
| "done";
|
|
1115
|
+
|
|
1116
|
+
/** Authoring slot identifier (parallel namespace to execution slots). */
|
|
1117
|
+
export type UltraPlanAuthoringSlotName =
|
|
1118
|
+
| "intake"
|
|
1119
|
+
| "scout"
|
|
1120
|
+
| "discoverer"
|
|
1121
|
+
| "researcher"
|
|
1122
|
+
| "planner"
|
|
1123
|
+
| "structure-checker"
|
|
1124
|
+
| "scope-checker"
|
|
1125
|
+
| "tdd-checker";
|
|
1126
|
+
|
|
1127
|
+
/** Pipeline mode: how aggressively the pipeline gates on user approval. */
|
|
1128
|
+
export type UltraPlanAuthoringPipelineMode =
|
|
1129
|
+
| "single-shot" // legacy quick path (ultraplan_create)
|
|
1130
|
+
| "multi-stage"; // default GSD-style pipeline
|
|
1131
|
+
|
|
1132
|
+
/** Severity of a finding raised by a plan-checker against a draft. */
|
|
1133
|
+
export type UltraPlanAuthoringFindingSeverity = "BLOCKER" | "WARNING";
|
|
1134
|
+
|
|
1135
|
+
/** Which checker raised a finding. */
|
|
1136
|
+
export type UltraPlanAuthoringFindingSource =
|
|
1137
|
+
| "structure-checker"
|
|
1138
|
+
| "scope-checker"
|
|
1139
|
+
| "tdd-checker";
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* One item raised against a draft during REVIEW. Multiple findings consolidate into one
|
|
1143
|
+
* `findings.json` per iteration.
|
|
1144
|
+
*/
|
|
1145
|
+
export interface UltraPlanAuthoringFinding {
|
|
1146
|
+
id: string;
|
|
1147
|
+
severity: UltraPlanAuthoringFindingSeverity;
|
|
1148
|
+
source: UltraPlanAuthoringFindingSource;
|
|
1149
|
+
/** Where the finding applies; null when it is session-wide. */
|
|
1150
|
+
target: {
|
|
1151
|
+
stack: UltraPlanStackId | null;
|
|
1152
|
+
domainId: string | null;
|
|
1153
|
+
scenarioId: string | null;
|
|
1154
|
+
};
|
|
1155
|
+
/** Human-readable summary, presented to the user and to the revising planner. */
|
|
1156
|
+
message: string;
|
|
1157
|
+
/** Concrete recommendation for fixing the issue. */
|
|
1158
|
+
recommendation: string;
|
|
1159
|
+
recordedAt: string;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Block of findings persisted to `drafts/iteration-N/findings.json`. The reducer reads it
|
|
1164
|
+
* to decide whether to converge, revise, or escalate.
|
|
1165
|
+
*/
|
|
1166
|
+
export interface UltraPlanAuthoringFindingsArtifact {
|
|
1167
|
+
iteration: number;
|
|
1168
|
+
draftRef: string;
|
|
1169
|
+
recordedAt: string;
|
|
1170
|
+
findings: UltraPlanAuthoringFinding[];
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Per-stage artifact references. Filenames are relative to `<session>/authoring/`.
|
|
1175
|
+
*
|
|
1176
|
+
* `research` is an array of stack-keyed entries because researchers fan out per applicable
|
|
1177
|
+
* stack. `draft` and `findings` reference iteration-numbered files; only the latest is
|
|
1178
|
+
* retained on this struct (older iterations live on disk for forensics).
|
|
1179
|
+
*/
|
|
1180
|
+
export interface UltraPlanAuthoringArtifactRefs {
|
|
1181
|
+
intake?: string;
|
|
1182
|
+
scout?: string;
|
|
1183
|
+
discuss?: string;
|
|
1184
|
+
deferredIdeas?: string;
|
|
1185
|
+
research?: { stack: UltraPlanStackId; path: string }[];
|
|
1186
|
+
researchSummary?: string;
|
|
1187
|
+
draft?: string;
|
|
1188
|
+
draftMarkdown?: string;
|
|
1189
|
+
findings?: string;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* The `authoring` block embedded inside `manifest.json` for sessions that have not yet been
|
|
1194
|
+
* approved. Once a session reaches APPROVE and is promoted, this block is cleared and the
|
|
1195
|
+
* top-level `state` becomes `"ready"`.
|
|
1196
|
+
*/
|
|
1197
|
+
export interface UltraPlanAuthoringState {
|
|
1198
|
+
pipeline: UltraPlanAuthoringPipelineMode;
|
|
1199
|
+
stage: UltraPlanAuthoringStage;
|
|
1200
|
+
stageStatus: UltraPlanAuthoringStageStatus;
|
|
1201
|
+
/** Iteration counter for the REVIEW \u2194 SYNTHESIZE revision loop. 1-indexed. */
|
|
1202
|
+
iteration: number;
|
|
1203
|
+
/** How many times the user has re-entered the loop after a stall warning. */
|
|
1204
|
+
stallReentryCount: number;
|
|
1205
|
+
artifacts: UltraPlanAuthoringArtifactRefs;
|
|
1206
|
+
blocker: UltraPlanBlocker | null;
|
|
1207
|
+
startedAt: string;
|
|
1208
|
+
updatedAt: string;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Append-only event written to `<session>/authoring/pipeline-log.jsonl` whenever the pipeline
|
|
1213
|
+
* transitions. Mirrors `execution-log.jsonl` so the same reader can consume both streams.
|
|
1214
|
+
*/
|
|
1215
|
+
export interface UltraPlanAuthoringPipelineEvent {
|
|
1216
|
+
recordedAt: string;
|
|
1217
|
+
stage: UltraPlanAuthoringStage;
|
|
1218
|
+
stageStatus: UltraPlanAuthoringStageStatus;
|
|
1219
|
+
iteration: number;
|
|
1220
|
+
/** Human-readable summary; empty allowed when the event is purely structural. */
|
|
1221
|
+
summary: string;
|
|
1222
|
+
/** Optional structured payload (artifact path, finding count, model id, etc.). */
|
|
1223
|
+
details?: Record<string, unknown>;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
// ---------------------------------------------------------------------------
|
|
1228
|
+
// UltraPlan Slice-2 runtime contracts
|
|
1229
|
+
// ---------------------------------------------------------------------------
|
|
1230
|
+
|
|
1231
|
+
export type UltraPlanHookEventName =
|
|
1232
|
+
| "session_start"
|
|
1233
|
+
| "before_agent_start"
|
|
1234
|
+
| "tool_call"
|
|
1235
|
+
| "tool_result"
|
|
1236
|
+
| "agent_end"
|
|
1237
|
+
| "session_shutdown";
|
|
1238
|
+
|
|
1239
|
+
export type UltraPlanActorKind = "slot" | "main-orchestrator";
|
|
1240
|
+
|
|
1241
|
+
export type UltraPlanSourceAgent = "main" | "sub-agent";
|
|
1242
|
+
|
|
1243
|
+
export type UltraPlanAttemptOutcome =
|
|
1244
|
+
| "advanced"
|
|
1245
|
+
| "blocked"
|
|
1246
|
+
| "interrupted"
|
|
1247
|
+
| "noop";
|
|
1248
|
+
|
|
1249
|
+
export type UltraPlanMutationKind =
|
|
1250
|
+
| "noop"
|
|
1251
|
+
| "start-attempt"
|
|
1252
|
+
| "stage-observation"
|
|
1253
|
+
| "advance"
|
|
1254
|
+
| "block"
|
|
1255
|
+
| "interrupt"
|
|
1256
|
+
| "repair"
|
|
1257
|
+
| "complete";
|
|
1258
|
+
|
|
1259
|
+
export type UltraPlanRuntimeBlockerCode =
|
|
1260
|
+
| "correlation-ambiguous"
|
|
1261
|
+
| "proof-missing"
|
|
1262
|
+
| "proof-invalid"
|
|
1263
|
+
| "conflicting-evidence"
|
|
1264
|
+
| "interrupted-attempt"
|
|
1265
|
+
| "persistence-failure"
|
|
1266
|
+
| "unsafe-repair-required"
|
|
1267
|
+
| "migration-unsafe"
|
|
1268
|
+
| "migration-conflict";
|
|
1269
|
+
|
|
1270
|
+
export interface UltraPlanLaunchContext {
|
|
1271
|
+
attemptId: string;
|
|
1272
|
+
attemptKey: string;
|
|
1273
|
+
sourceAgent: UltraPlanSourceAgent;
|
|
1274
|
+
launchedAt: string;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
export interface UltraPlanObservationTarget {
|
|
1278
|
+
targetType: UltraPlanCursorTargetType;
|
|
1279
|
+
stack: UltraPlanStackId | null;
|
|
1280
|
+
domainId: string | null;
|
|
1281
|
+
level: UltraPlanScenarioLevel | null;
|
|
1282
|
+
scenarioId: string | null;
|
|
1283
|
+
phase: UltraPlanExecutionPhase;
|
|
1284
|
+
resolvedSlot: string | null;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
export interface UltraPlanObservationCorrelationFailure {
|
|
1288
|
+
reason: string;
|
|
1289
|
+
details?: Record<string, unknown>;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
export interface UltraPlanHookObservation {
|
|
1293
|
+
sessionId: string;
|
|
1294
|
+
hookEvent: UltraPlanHookEventName;
|
|
1295
|
+
actorKind: UltraPlanActorKind;
|
|
1296
|
+
attemptId: string | null;
|
|
1297
|
+
attemptKey: string | null;
|
|
1298
|
+
sourceAgent: UltraPlanSourceAgent;
|
|
1299
|
+
occurredAt: string;
|
|
1300
|
+
causationId: string | null;
|
|
1301
|
+
fingerprint: string;
|
|
1302
|
+
target: UltraPlanObservationTarget | null;
|
|
1303
|
+
correlationFailure: UltraPlanObservationCorrelationFailure | null;
|
|
1304
|
+
payloadSummary: string;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
export interface UltraPlanProofCandidateTarget {
|
|
1308
|
+
targetType: UltraPlanCursorTargetType;
|
|
1309
|
+
stack: UltraPlanStackId | null;
|
|
1310
|
+
domainId: string | null;
|
|
1311
|
+
level: UltraPlanScenarioLevel | null;
|
|
1312
|
+
scenarioId: string | null;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
export interface UltraPlanProofCandidate {
|
|
1316
|
+
phase: UltraPlanExecutionPhase;
|
|
1317
|
+
type: UltraPlanProofType;
|
|
1318
|
+
target: UltraPlanProofCandidateTarget;
|
|
1319
|
+
evidence: UltraPlanProofEvidence;
|
|
1320
|
+
artifactRef: string | null;
|
|
1321
|
+
observationFingerprint: string;
|
|
1322
|
+
fingerprint: string;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
export interface UltraPlanBlockerCandidate {
|
|
1326
|
+
blocker: UltraPlanBlocker;
|
|
1327
|
+
observationFingerprint: string;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
export interface UltraPlanAttemptRecord {
|
|
1331
|
+
attemptId: string;
|
|
1332
|
+
attemptKey: string;
|
|
1333
|
+
launchContext: UltraPlanLaunchContext;
|
|
1334
|
+
cursorSnapshot: UltraPlanCursor | null;
|
|
1335
|
+
observations: UltraPlanHookObservation[];
|
|
1336
|
+
proofCandidates: UltraPlanProofCandidate[];
|
|
1337
|
+
blockerCandidates: UltraPlanBlockerCandidate[];
|
|
1338
|
+
outcome: UltraPlanAttemptOutcome | null;
|
|
1339
|
+
startedAt: string;
|
|
1340
|
+
finalizedAt: string | null;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
export interface UltraPlanScenarioStatusUpdate {
|
|
1344
|
+
stack: UltraPlanStackId;
|
|
1345
|
+
domainId: string;
|
|
1346
|
+
level: UltraPlanScenarioLevel;
|
|
1347
|
+
scenarioId: string;
|
|
1348
|
+
nextStatus: UltraPlanScenarioStatus;
|
|
1349
|
+
appendProof?: UltraPlanProof;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
export interface UltraPlanReviewStatusUpdate {
|
|
1353
|
+
type: "domain" | "stack";
|
|
1354
|
+
stack: UltraPlanStackId;
|
|
1355
|
+
domainId: string | null;
|
|
1356
|
+
nextStatus: UltraPlanReviewStatus;
|
|
1357
|
+
artifactRef: string | null;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
export interface UltraPlanBlockerUpdate {
|
|
1361
|
+
scope: UltraPlanBlockerScope;
|
|
1362
|
+
nextValue: UltraPlanBlocker | null;
|
|
1363
|
+
clearedByObservationFingerprint: string | null;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
export type UltraPlanRepairAction =
|
|
1367
|
+
| { op: "recompute-cursor"; reason: string }
|
|
1368
|
+
| { op: "recompute-progress"; reason: string }
|
|
1369
|
+
| { op: "clear-active-attempt"; reason: string }
|
|
1370
|
+
| { op: "convert-active-to-interrupted"; attemptId: string; reason: string }
|
|
1371
|
+
| { op: "clear-blocker"; scope: UltraPlanBlockerScope; clearedByObservationFingerprint: string };
|
|
1372
|
+
|
|
1373
|
+
export interface UltraPlanTrackerAttemptFinalization {
|
|
1374
|
+
attemptId: string;
|
|
1375
|
+
outcome: UltraPlanAttemptOutcome;
|
|
1376
|
+
finalizedAt: string;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
export interface UltraPlanMutationPlan {
|
|
1380
|
+
kind: UltraPlanMutationKind;
|
|
1381
|
+
rationale: string;
|
|
1382
|
+
appendObservationFingerprint: string | null;
|
|
1383
|
+
scenarioStatusUpdate: UltraPlanScenarioStatusUpdate | null;
|
|
1384
|
+
reviewStatusUpdate: UltraPlanReviewStatusUpdate | null;
|
|
1385
|
+
blockerUpdate: UltraPlanBlockerUpdate | null;
|
|
1386
|
+
cursorUpdate: UltraPlanCursor | null;
|
|
1387
|
+
sessionStateUpdate: UltraPlanSessionState | null;
|
|
1388
|
+
trackerAttemptFinalization: UltraPlanTrackerAttemptFinalization | null;
|
|
1389
|
+
recomputeProgress: boolean;
|
|
1390
|
+
repairActions: UltraPlanRepairAction[];
|
|
1391
|
+
notes: string[];
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
export interface UltraPlanPendingMutation {
|
|
1395
|
+
attemptId: string;
|
|
1396
|
+
mutationPlan: UltraPlanMutationPlan;
|
|
1397
|
+
expectedManifestFingerprint: string;
|
|
1398
|
+
stagedAt: string;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
export interface UltraPlanRuntimeTracker {
|
|
1402
|
+
version: 1;
|
|
1403
|
+
sessionId: string;
|
|
1404
|
+
activeAttempt: UltraPlanAttemptRecord | null;
|
|
1405
|
+
finalizedAttempts: UltraPlanAttemptRecord[];
|
|
1406
|
+
appliedFingerprints: string[];
|
|
1407
|
+
pendingMutation: UltraPlanPendingMutation | null;
|
|
1408
|
+
updatedAt: string;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
export interface UltraPlanRepairDetails {
|
|
1412
|
+
reason: string;
|
|
1413
|
+
actions: UltraPlanRepairAction[];
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
export type UltraPlanReducerAction =
|
|
1417
|
+
| { kind: "session_started"; observation: UltraPlanHookObservation; nowIso: string }
|
|
1418
|
+
| { kind: "attempt_started"; observation: UltraPlanHookObservation; launchContext: UltraPlanLaunchContext }
|
|
1419
|
+
| { kind: "observation_staged"; observation: UltraPlanHookObservation }
|
|
1420
|
+
| { kind: "attempt_finalized"; observation: UltraPlanHookObservation; nowIso: string }
|
|
1421
|
+
| { kind: "session_shutdown"; observation: UltraPlanHookObservation; nowIso: string }
|
|
1422
|
+
| { kind: "repair_applied"; nowIso: string; details: UltraPlanRepairDetails };
|
|
1423
|
+
|
|
1424
|
+
export type UltraPlanSessionMigrationKind = "copied" | "reconciled-no-op";
|
|
1425
|
+
|
|
1426
|
+
export interface UltraPlanSessionMigrationRecord {
|
|
1427
|
+
migratedAt: string;
|
|
1428
|
+
legacyPath: string;
|
|
1429
|
+
fingerprintBefore: string;
|
|
1430
|
+
fingerprintAfter: string;
|
|
1431
|
+
legacyRenamedTo: string | null;
|
|
1432
|
+
kind: UltraPlanSessionMigrationKind;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
// ---------------------------------------------------------------------------
|
|
1436
|
+
// UltraPlan Slice-7 batch orchestration contracts
|
|
1437
|
+
// ---------------------------------------------------------------------------
|
|
1438
|
+
|
|
1439
|
+
export type UltraPlanBatchRunState = "paused" | "running" | "blocked" | "complete" | "abandoned";
|
|
1440
|
+
|
|
1441
|
+
export type UltraPlanBatchNodeState =
|
|
1442
|
+
| "pending"
|
|
1443
|
+
| "preparing"
|
|
1444
|
+
| "running"
|
|
1445
|
+
| "merge-pending"
|
|
1446
|
+
| "paused"
|
|
1447
|
+
| "blocked"
|
|
1448
|
+
| "awaiting-user"
|
|
1449
|
+
| "merged"
|
|
1450
|
+
| "abandoned";
|
|
1451
|
+
|
|
1452
|
+
export type UltraPlanBatchNodeBlockerKind = "dependency" | "session" | "merge" | "supervisor";
|
|
1453
|
+
|
|
1454
|
+
export type UltraPlanBatchBlockerCode =
|
|
1455
|
+
| "project-identity-failed"
|
|
1456
|
+
| "invalid-run"
|
|
1457
|
+
| "supervisor-worktree-invalid"
|
|
1458
|
+
| "base-drift"
|
|
1459
|
+
| "merge-blocked";
|
|
1460
|
+
|
|
1461
|
+
export type UltraPlanBatchJournalEventType =
|
|
1462
|
+
| "run-created"
|
|
1463
|
+
| "lease-acquired"
|
|
1464
|
+
| "lease-released"
|
|
1465
|
+
| "node-preparing"
|
|
1466
|
+
| "node-running"
|
|
1467
|
+
| "node-paused"
|
|
1468
|
+
| "node-blocked"
|
|
1469
|
+
| "node-awaiting-user"
|
|
1470
|
+
| "node-merge-pending"
|
|
1471
|
+
| "node-merged"
|
|
1472
|
+
| "node-abandoned"
|
|
1473
|
+
| "cleanup-warning";
|
|
1474
|
+
|
|
1475
|
+
export interface UltraPlanBatchWave {
|
|
1476
|
+
waveIndex: number;
|
|
1477
|
+
sessionIds: string[];
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
export interface UltraPlanBatchNode {
|
|
1481
|
+
nodeId: string;
|
|
1482
|
+
sessionId: string;
|
|
1483
|
+
title: string;
|
|
1484
|
+
waveIndex: number;
|
|
1485
|
+
dependencies: string[];
|
|
1486
|
+
state: UltraPlanBatchNodeState;
|
|
1487
|
+
blockerKind: UltraPlanBatchNodeBlockerKind | null;
|
|
1488
|
+
blockerSummary: string | null;
|
|
1489
|
+
resumeRequestedAt: string | null;
|
|
1490
|
+
branchName: string | null;
|
|
1491
|
+
worktreePath: string | null;
|
|
1492
|
+
updatedAt: string;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
export interface UltraPlanBatchRun {
|
|
1496
|
+
runId: string;
|
|
1497
|
+
projectRoot: string;
|
|
1498
|
+
baseBranch: string;
|
|
1499
|
+
baseHead: string;
|
|
1500
|
+
currentBaseHead: string;
|
|
1501
|
+
createdAt: string;
|
|
1502
|
+
updatedAt: string;
|
|
1503
|
+
state: UltraPlanBatchRunState;
|
|
1504
|
+
maxParallelism: number;
|
|
1505
|
+
batchBlockerCode: UltraPlanBatchBlockerCode | null;
|
|
1506
|
+
batchBlockerSummary: string | null;
|
|
1507
|
+
batchResumeRequestedAt: string | null;
|
|
1508
|
+
supervisorWorktreePath: string | null;
|
|
1509
|
+
waves: UltraPlanBatchWave[];
|
|
1510
|
+
nodes: UltraPlanBatchNode[];
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
export interface UltraPlanBatchActiveRunLease {
|
|
1514
|
+
runId: string;
|
|
1515
|
+
ownerSessionId: string | null;
|
|
1516
|
+
leaseAcquiredAt: string | null;
|
|
1517
|
+
leaseExpiresAt: string | null;
|
|
1518
|
+
updatedAt: string;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
export interface UltraPlanBatchJournalEvent {
|
|
1522
|
+
runId: string;
|
|
1523
|
+
sessionId: string | null;
|
|
1524
|
+
type: UltraPlanBatchJournalEventType;
|
|
1525
|
+
recordedAt: string;
|
|
1526
|
+
summary: string;
|
|
1527
|
+
details?: Record<string, unknown>;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
// ---------------------------------------------------------------------------
|
|
1531
|
+
// Harness pipeline (Tier 1 + Tier 2 + Tier 3 anti-slop)
|
|
1532
|
+
//
|
|
1533
|
+
// Persisted under `~/.omp/supipowers/projects/<slug>/harness/<sessionId>/`. Output writes to
|
|
1534
|
+
// the repo root (Tier 1 agent-neutral artifacts) and `.omp/supipowers/` (Tier 2 + Tier 3
|
|
1535
|
+
// supipowers-aware artifacts and project-scoped queue/score files).
|
|
1536
|
+
// ---------------------------------------------------------------------------
|
|
1537
|
+
|
|
1538
|
+
/** Stages of the harness pipeline. Order is meaningful. */
|
|
1539
|
+
export type HarnessStage =
|
|
1540
|
+
| "discover"
|
|
1541
|
+
| "research"
|
|
1542
|
+
| "design"
|
|
1543
|
+
| "plan"
|
|
1544
|
+
| "implement"
|
|
1545
|
+
| "validate";
|
|
1546
|
+
|
|
1547
|
+
/** Operational status of a harness stage. Mirrors UltraPlanAuthoringStageStatus. */
|
|
1548
|
+
export type HarnessStageStatus =
|
|
1549
|
+
| "pending"
|
|
1550
|
+
| "running"
|
|
1551
|
+
| "blocked"
|
|
1552
|
+
| "awaiting-user"
|
|
1553
|
+
| "done";
|
|
1554
|
+
|
|
1555
|
+
/** Pipeline gate mode (mirrors PipelineGateMode in ultraplan). */
|
|
1556
|
+
export type HarnessGateMode = "default" | "auto" | "manual";
|
|
1557
|
+
|
|
1558
|
+
/** Re-run behavior decided by bare entry when an existing harness is detected. */
|
|
1559
|
+
export type HarnessReRunMode = "harden" | "rebuild" | "cancel";
|
|
1560
|
+
|
|
1561
|
+
/** Anti-slop backend selection (Design stage). */
|
|
1562
|
+
export type HarnessAntiSlopBackend =
|
|
1563
|
+
| "fallow"
|
|
1564
|
+
| "desloppify"
|
|
1565
|
+
| "supi-native"
|
|
1566
|
+
| "hybrid";
|
|
1567
|
+
|
|
1568
|
+
/** Slop-violation kind. Open-ended on purpose so adapters can add new sources. */
|
|
1569
|
+
export type HarnessSlopViolationKind =
|
|
1570
|
+
| "duplicate"
|
|
1571
|
+
| "dead-code"
|
|
1572
|
+
| "layer-violation"
|
|
1573
|
+
| "naming"
|
|
1574
|
+
| "file-too-large"
|
|
1575
|
+
| "complexity"
|
|
1576
|
+
| "circular-dependency"
|
|
1577
|
+
| "other";
|
|
1578
|
+
|
|
1579
|
+
/** Source of a slop-queue entry. */
|
|
1580
|
+
export type HarnessSlopSource = "fallow" | "desloppify" | "checks" | "review" | "supi-native";
|
|
1581
|
+
|
|
1582
|
+
/** Severity tier for queue entries. */
|
|
1583
|
+
export type HarnessSlopSeverity = "blocker" | "warning" | "info";
|
|
1584
|
+
|
|
1585
|
+
/** Lifecycle state of a queue entry. */
|
|
1586
|
+
export type HarnessSlopState = "open" | "resolved" | "wontfix";
|
|
1587
|
+
|
|
1588
|
+
/** A single slop-queue entry. JSONL-persisted, append-only with replacement on resolve. */
|
|
1589
|
+
export interface HarnessSlopQueueEntry {
|
|
1590
|
+
id: string;
|
|
1591
|
+
kind: HarnessSlopViolationKind;
|
|
1592
|
+
file: string;
|
|
1593
|
+
/** Range as (start_line, end_line) or null when range is the whole file. */
|
|
1594
|
+
range: { startLine: number; endLine: number } | null;
|
|
1595
|
+
severity: HarnessSlopSeverity;
|
|
1596
|
+
source: HarnessSlopSource;
|
|
1597
|
+
state: HarnessSlopState;
|
|
1598
|
+
message: string;
|
|
1599
|
+
remediation?: string;
|
|
1600
|
+
/** Ids of related/clustered entries (e.g. duplicate-cluster siblings). */
|
|
1601
|
+
clusters?: string[];
|
|
1602
|
+
/** ISO8601 timestamp the entry was first observed. */
|
|
1603
|
+
ts: string;
|
|
1604
|
+
/** ISO8601 timestamp of the last state change. */
|
|
1605
|
+
resolvedAt?: string;
|
|
1606
|
+
/** Free-form metadata (e.g. fallow rule id, near-dup partner path:line). */
|
|
1607
|
+
details?: Record<string, unknown>;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
/** Harness scorecard breakdown. */
|
|
1611
|
+
export interface HarnessScoreDimension {
|
|
1612
|
+
name: string;
|
|
1613
|
+
/** Lenient: ignores wontfix items. Range 0-100. */
|
|
1614
|
+
lenient: number;
|
|
1615
|
+
/** Strict: counts wontfix items as cost. Range 0-100. */
|
|
1616
|
+
strict: number;
|
|
1617
|
+
/** Total entries that contributed to the score. */
|
|
1618
|
+
total: number;
|
|
1619
|
+
open: number;
|
|
1620
|
+
resolved: number;
|
|
1621
|
+
wontfix: number;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
/** Aggregate harness score. */
|
|
1625
|
+
export interface HarnessScore {
|
|
1626
|
+
/** ISO8601 of computation. */
|
|
1627
|
+
computedAt: string;
|
|
1628
|
+
lenient: number;
|
|
1629
|
+
strict: number;
|
|
1630
|
+
dimensions: HarnessScoreDimension[];
|
|
1631
|
+
/** Optional trend buckets, oldest first. */
|
|
1632
|
+
trend?: { ts: string; lenient: number; strict: number }[];
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
/** Layer rule parsed from docs/architecture.md. */
|
|
1636
|
+
export interface HarnessLayerRule {
|
|
1637
|
+
/** Layer label, e.g. "domain", "infrastructure", "ui". */
|
|
1638
|
+
layer: string;
|
|
1639
|
+
/** Glob patterns matching files belonging to this layer. */
|
|
1640
|
+
globs: string[];
|
|
1641
|
+
/** Layers (or path globs) this layer is permitted to import. */
|
|
1642
|
+
allowedImports: string[];
|
|
1643
|
+
/** Layers (or path globs) this layer is forbidden from importing. */
|
|
1644
|
+
forbiddenImports: string[];
|
|
1645
|
+
/** Optional human-readable description. */
|
|
1646
|
+
description?: string;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
/** Per-hook configuration. */
|
|
1650
|
+
export interface HarnessHookConfig {
|
|
1651
|
+
pre_edit_dupe_probe: {
|
|
1652
|
+
enabled: boolean;
|
|
1653
|
+
/** Minimum similarity threshold (0-1). Default 0.85. */
|
|
1654
|
+
threshold: number;
|
|
1655
|
+
/** Minimum token count below which probe is skipped. Default 30. */
|
|
1656
|
+
min_token_count: number;
|
|
1657
|
+
};
|
|
1658
|
+
post_session_sweep: {
|
|
1659
|
+
enabled: boolean;
|
|
1660
|
+
/** Whether to surface a blocking steer message on new dead code. Default false. */
|
|
1661
|
+
block_on_new_dead_code: boolean;
|
|
1662
|
+
};
|
|
1663
|
+
layer_context_inject: {
|
|
1664
|
+
enabled: boolean;
|
|
1665
|
+
/** Maximum characters of addendum to inject. Default 800. */
|
|
1666
|
+
addendum_max_chars: number;
|
|
1667
|
+
};
|
|
1668
|
+
score_floor: {
|
|
1669
|
+
/** Strict score floor for /supi:checks blocking. Default 75. */
|
|
1670
|
+
strict: number;
|
|
1671
|
+
/** Lenient score floor. Default 90. */
|
|
1672
|
+
lenient: number;
|
|
1673
|
+
/** When true, GC exits non-zero if strict < strict floor. Default false. */
|
|
1674
|
+
release_blocking: boolean;
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
/** The harness section of SupipowersConfig. */
|
|
1679
|
+
export interface HarnessConfig {
|
|
1680
|
+
anti_slop: HarnessHookConfig;
|
|
1681
|
+
/** Selected backend (recorded by Design). */
|
|
1682
|
+
backend?: HarnessAntiSlopBackend;
|
|
1683
|
+
/** Threshold above which Implement defers to ultraplan batch. Default 10. */
|
|
1684
|
+
implement_in_session_threshold?: number;
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
/** Discover artifact (`<session>/discover.json`). */
|
|
1688
|
+
export interface HarnessDiscoverArtifact {
|
|
1689
|
+
sessionId: string;
|
|
1690
|
+
recordedAt: string;
|
|
1691
|
+
/** Detected primary languages (lowercase). */
|
|
1692
|
+
languages: string[];
|
|
1693
|
+
/** Detected frameworks/libraries by category. */
|
|
1694
|
+
frameworks: string[];
|
|
1695
|
+
packageManagers: string[];
|
|
1696
|
+
buildTools: string[];
|
|
1697
|
+
testTools: string[];
|
|
1698
|
+
lintTools: string[];
|
|
1699
|
+
/** Repo shape: monorepo/single-package. */
|
|
1700
|
+
monorepoShape: "single-package" | "monorepo" | "polyglot" | "unknown";
|
|
1701
|
+
ci: { detected: boolean; provider?: string; configFiles: string[] };
|
|
1702
|
+
/** Existing OMP/supipowers infra detected. */
|
|
1703
|
+
ompInfra: {
|
|
1704
|
+
hasSupipowers: boolean;
|
|
1705
|
+
skills: string[];
|
|
1706
|
+
reviewAgents: string[];
|
|
1707
|
+
mcpServers: string[];
|
|
1708
|
+
plansCount: number;
|
|
1709
|
+
};
|
|
1710
|
+
/** Existing anti-slop tooling. */
|
|
1711
|
+
antiSlopExisting: {
|
|
1712
|
+
fallowConfig: string | null;
|
|
1713
|
+
desloppifyConfig: string | null;
|
|
1714
|
+
knipConfig: string | null;
|
|
1715
|
+
jscpdConfig: string | null;
|
|
1716
|
+
dependencyCruiserConfig: string | null;
|
|
1717
|
+
eslintConfig: string | null;
|
|
1718
|
+
biomeConfig: string | null;
|
|
1719
|
+
};
|
|
1720
|
+
/** Language coverage for backend recommendation. */
|
|
1721
|
+
languageCoverage: { language: string; fileCount: number; share: number }[];
|
|
1722
|
+
/** Recommended anti-slop backend. */
|
|
1723
|
+
recommendedBackend: HarnessAntiSlopBackend;
|
|
1724
|
+
recommendedBackendReason: string;
|
|
1725
|
+
commitConventions: { detected: boolean; style?: string };
|
|
1726
|
+
duplicates: { area: string; existing: string; conflict: string }[];
|
|
1727
|
+
notes: string[];
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
/** Research artifact (`<session>/research/<topic>.md`). Markdown body, schema for the
|
|
1731
|
+
* frontmatter only. */
|
|
1732
|
+
export interface HarnessResearchFrontmatter {
|
|
1733
|
+
topic: string;
|
|
1734
|
+
/** ISO timestamp of last verification (re-run-safe). */
|
|
1735
|
+
lastVerified: string;
|
|
1736
|
+
/** Source URLs cited in the writeup; minimum 2 for the validator to pass. */
|
|
1737
|
+
sources: string[];
|
|
1738
|
+
/** Whether the writeup contains the required `## Options` and `## Recommendation` sections. */
|
|
1739
|
+
hasOptions: boolean;
|
|
1740
|
+
hasRecommendation: boolean;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
/** Executable proof contract for a harness quality gate. */
|
|
1744
|
+
export interface HarnessQualityGate {
|
|
1745
|
+
/** Stable gate name, e.g. "typecheck" or "anti-slop-scan". */
|
|
1746
|
+
name: string;
|
|
1747
|
+
/** Product or engineering rule protected by the gate. */
|
|
1748
|
+
invariant: string;
|
|
1749
|
+
/** Command or deterministic check to run; null when owned by the harness runtime. */
|
|
1750
|
+
command: string | null;
|
|
1751
|
+
/** Exact claim a passing gate allows. */
|
|
1752
|
+
proves: string;
|
|
1753
|
+
/** Known blind spot that remains after a pass. */
|
|
1754
|
+
doesNotProve: string;
|
|
1755
|
+
/** Where this proof runs: local command, CI, install, PR, schedule, etc. */
|
|
1756
|
+
runsAt: string;
|
|
1757
|
+
/** Blocking condition: exit code, severity threshold, diff attribution, etc. */
|
|
1758
|
+
blocksOn: string;
|
|
1759
|
+
/** Durable proof left behind: logs, JSON, SARIF, screenshots, traces, report, etc. */
|
|
1760
|
+
artifact: string;
|
|
1761
|
+
/** Missing config, network failure, retry, or fallback behavior. */
|
|
1762
|
+
failSafe: string;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
/** CI and local counterpart wiring chosen during harness design. */
|
|
1766
|
+
export interface HarnessCiConfig {
|
|
1767
|
+
provider: "github-actions";
|
|
1768
|
+
trigger:
|
|
1769
|
+
| { mode: "all-prs" }
|
|
1770
|
+
| { mode: "branches"; branches: string[] };
|
|
1771
|
+
/** Local command CI must invoke, e.g. `bun run harness:quality`. */
|
|
1772
|
+
localCommand: string;
|
|
1773
|
+
/** CI workflow path relative to repo root. */
|
|
1774
|
+
workflowPath: string;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
|
|
1778
|
+
/** Design spec artifact metadata (`<session>/design-spec.md` + decisions.jsonl). */
|
|
1779
|
+
export interface HarnessDesignSpec {
|
|
1780
|
+
sessionId: string;
|
|
1781
|
+
recordedAt: string;
|
|
1782
|
+
/** Layered architecture rules user agreed to. */
|
|
1783
|
+
layerRules: HarnessLayerRule[];
|
|
1784
|
+
/** Taste invariants (text bullets). */
|
|
1785
|
+
tasteInvariants: string[];
|
|
1786
|
+
/** Tooling choices. */
|
|
1787
|
+
tooling: {
|
|
1788
|
+
lint: string | null;
|
|
1789
|
+
structuralTest: string | null;
|
|
1790
|
+
eval: string | null;
|
|
1791
|
+
};
|
|
1792
|
+
/** Top 10 mechanical golden principles. */
|
|
1793
|
+
goldenPrinciples: string[];
|
|
1794
|
+
/** Documentation tree shape (paths under docs/). */
|
|
1795
|
+
docsTree: string[];
|
|
1796
|
+
/** Validation gates the harness should install, each with an explicit proof contract. */
|
|
1797
|
+
validationGates: HarnessQualityGate[];
|
|
1798
|
+
/** CI workflow plus local command that runs the validation gates. */
|
|
1799
|
+
ci: HarnessCiConfig;
|
|
1800
|
+
/** supipowers wiring opted-in by the user. */
|
|
1801
|
+
supipowersWiring: {
|
|
1802
|
+
addReviewAgent: boolean;
|
|
1803
|
+
wireChecksGate: boolean;
|
|
1804
|
+
};
|
|
1805
|
+
/** Anti-slop section. */
|
|
1806
|
+
antiSlop: {
|
|
1807
|
+
backend: HarnessAntiSlopBackend;
|
|
1808
|
+
hooks: HarnessHookConfig;
|
|
1809
|
+
skillTargets: string[];
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
/** A single decision recorded during Design. */
|
|
1814
|
+
export interface HarnessDecisionRecord {
|
|
1815
|
+
recordedAt: string;
|
|
1816
|
+
area: string;
|
|
1817
|
+
question: string;
|
|
1818
|
+
decision: string;
|
|
1819
|
+
rationale?: string;
|
|
1820
|
+
impact?: string[];
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
/** Validate report (`<session>/validate-report.json`). */
|
|
1824
|
+
export interface HarnessValidateCheck {
|
|
1825
|
+
name: string;
|
|
1826
|
+
passed: boolean;
|
|
1827
|
+
summary: string;
|
|
1828
|
+
findings: HarnessValidateFinding[];
|
|
1829
|
+
durationMs?: number;
|
|
1830
|
+
invariant: string;
|
|
1831
|
+
proves: string;
|
|
1832
|
+
doesNotProve: string;
|
|
1833
|
+
artifact: string;
|
|
1834
|
+
failSafe: string;
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
export interface HarnessValidateReport {
|
|
1838
|
+
sessionId: string;
|
|
1839
|
+
recordedAt: string;
|
|
1840
|
+
passed: boolean;
|
|
1841
|
+
/** Sub-check results, one per sub-check name. */
|
|
1842
|
+
checks: HarnessValidateCheck[];
|
|
1843
|
+
/** Slop scan results merged from the selected backend. */
|
|
1844
|
+
slopScan: {
|
|
1845
|
+
backend: HarnessAntiSlopBackend;
|
|
1846
|
+
duplicates: number;
|
|
1847
|
+
deadCode: number;
|
|
1848
|
+
layerViolations: number;
|
|
1849
|
+
other: number;
|
|
1850
|
+
};
|
|
1851
|
+
score: HarnessScore;
|
|
1852
|
+
scoreFloorPassed: boolean;
|
|
1853
|
+
syntheticEditTest: {
|
|
1854
|
+
ran: boolean;
|
|
1855
|
+
hooksFired: string[];
|
|
1856
|
+
failures: string[];
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
/** A single Validate finding (file:line + remediation). */
|
|
1861
|
+
export interface HarnessValidateFinding {
|
|
1862
|
+
severity: "error" | "warning" | "info";
|
|
1863
|
+
file: string;
|
|
1864
|
+
line?: number;
|
|
1865
|
+
message: string;
|
|
1866
|
+
remediation: string;
|
|
1867
|
+
source: string;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
/** Harness session state (manifest.json under <session>/). */
|
|
1871
|
+
export interface HarnessSession {
|
|
1872
|
+
sessionId: string;
|
|
1873
|
+
projectName: string;
|
|
1874
|
+
startedAt: string;
|
|
1875
|
+
updatedAt: string;
|
|
1876
|
+
stage: HarnessStage;
|
|
1877
|
+
stageStatus: HarnessStageStatus;
|
|
1878
|
+
gateMode: HarnessGateMode;
|
|
1879
|
+
/** Iteration counter for retry budget (per-stage). */
|
|
1880
|
+
iteration: number;
|
|
1881
|
+
/** Re-run mode user chose at bare entry (when applicable). */
|
|
1882
|
+
reRunMode?: HarnessReRunMode;
|
|
1883
|
+
/** Recorded blocker, if any. */
|
|
1884
|
+
blocker: { code: string; message: string; detectedAt: string } | null;
|
|
1885
|
+
/** Artifacts produced so far (relative to <session>/). */
|
|
1886
|
+
artifacts: HarnessArtifactRefs;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/** Per-stage artifact references (relative to <session>/). */
|
|
1890
|
+
export interface HarnessArtifactRefs {
|
|
1891
|
+
discover?: string;
|
|
1892
|
+
research?: { topic: string; path: string }[];
|
|
1893
|
+
designSpec?: string;
|
|
1894
|
+
decisions?: string;
|
|
1895
|
+
plan?: string;
|
|
1896
|
+
implementLog?: string;
|
|
1897
|
+
validateReport?: string;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
/** Append-only pipeline log entry. */
|
|
1901
|
+
export interface HarnessPipelineEvent {
|
|
1902
|
+
recordedAt: string;
|
|
1903
|
+
stage: HarnessStage;
|
|
1904
|
+
stageStatus: HarnessStageStatus;
|
|
1905
|
+
iteration: number;
|
|
1906
|
+
summary: string;
|
|
1907
|
+
details?: Record<string, unknown>;
|
|
514
1908
|
}
|