@kontourai/flow-agents 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CODEOWNERS +8 -0
- package/.github/workflows/ci.yml +32 -0
- package/AGENTS.md +4 -4
- package/CHANGELOG.md +46 -0
- package/CONTEXT.md +14 -0
- package/README.md +9 -3
- package/agents/dev.json +1 -1
- package/agents/tool-code-reviewer.json +1 -1
- package/agents/tool-planner.json +3 -3
- package/agents/tool-verifier.json +3 -3
- package/build/src/cli/console-learning-projection.js +3 -2
- package/build/src/cli/init.js +104 -21
- package/build/src/cli/kit.js +37 -6
- package/build/src/cli/pull-work-provider.js +1 -1
- package/build/src/cli/usage-feedback.js +3 -3
- package/build/src/cli/validate-hook-influence.js +1 -0
- package/build/src/cli/validate-workflow-artifacts.js +22 -6
- package/build/src/cli/workflow-artifact-cleanup-audit.js +36 -2
- package/build/src/cli/workflow-sidecar.d.ts +14 -7
- package/build/src/cli/workflow-sidecar.js +792 -69
- package/build/src/flow-kit/validate.d.ts +23 -0
- package/build/src/flow-kit/validate.js +67 -1
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +1 -1
- package/build/src/lib/flow-resolver.d.ts +6 -4
- package/build/src/lib/flow-resolver.js +125 -58
- package/build/src/lib/local-artifact-root.d.ts +14 -2
- package/build/src/lib/local-artifact-root.js +22 -5
- package/build/src/lib/workflow-learning-projection.js +2 -2
- package/build/src/runtime-adapters.d.ts +12 -0
- package/build/src/runtime-adapters.js +56 -16
- package/build/src/tools/build-universal-bundles.js +49 -16
- package/build/src/tools/generate-context-map.js +10 -8
- package/build/src/tools/validate-source-tree.js +23 -1
- package/console.telemetry.json +22 -0
- package/context/contracts/artifact-contract.md +38 -7
- package/context/contracts/builder-kit-workflow-state-contract.md +3 -2
- package/context/contracts/decision-registry-contract.md +263 -0
- package/context/contracts/delivery-contract.md +1 -1
- package/context/contracts/planning-contract.md +2 -1
- package/context/contracts/review-contract.md +5 -3
- package/context/contracts/verification-contract.md +9 -1
- package/context/contracts/work-item-contract.md +1 -1
- package/context/deferred/parallelization.md +1 -1
- package/context/gate-awareness.md +4 -4
- package/context/scripts/git-status.sh +2 -2
- package/context/scripts/hooks/config-protection.js +502 -2
- package/context/scripts/hooks/lib/config-protection-remedies.js +69 -0
- package/context/scripts/hooks/run-hook.js +14 -1
- package/context/scripts/hooks/stop-goal-fit.js +1140 -99
- package/context/scripts/hooks/workflow-steering.js +212 -6
- package/docs/adr/0007-flow-skill-kit-tool-boundary.md +2 -0
- package/docs/adr/0015-flow-flow-agents-boundary-reconciliation.md +35 -0
- package/docs/adr/0019-kit-dependency-ownership.md +62 -0
- package/docs/adr/0020-trust-reconcile-manifest-and-claim-classification.md +290 -0
- package/docs/adr/0021-assignment-leases-and-stale-claim-takeover.md +221 -0
- package/docs/adr/0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md +283 -0
- package/docs/agent-system-guidebook.md +3 -3
- package/docs/agent-usage-feedback-loop.md +6 -6
- package/docs/context-map.md +9 -7
- package/docs/decisions/decision-records.md +57 -0
- package/docs/decisions/index.md +14 -0
- package/docs/decisions/promotion-gate.md +52 -0
- package/docs/developer-architecture.md +1 -1
- package/docs/fixture-ownership.md +3 -0
- package/docs/flow-kit-repository-contract.md +5 -5
- package/docs/getting-started.md +12 -2
- package/docs/integrations/harness-install.md +2 -1
- package/docs/kit-authoring-guide.md +64 -5
- package/docs/knowledge-kit.md +5 -1
- package/docs/learnings/2026-07-improvement-program.md +203 -0
- package/docs/migrations.md +6 -5
- package/docs/north-star.md +2 -2
- package/docs/operating-layers.md +4 -3
- package/docs/repository-structure.md +5 -5
- package/docs/skills-map.md +8 -8
- package/docs/spec/runtime-hook-surface.md +19 -15
- package/docs/spikes/graph-provider-2026-07.md +155 -0
- package/docs/standards-register.md +7 -7
- package/docs/trust-anchor-adoption.md +105 -4
- package/docs/work-item-adapters.md +1 -1
- package/docs/workflow-artifact-lifecycle.md +72 -9
- package/docs/workflow-eval-strategy.md +3 -3
- package/docs/workflow-shared-contracts.md +1 -1
- package/docs/workflow-usage-guide.md +254 -21
- package/evals/acceptance/DEMO-false-completion.md +20 -11
- package/evals/acceptance/prove-capture-teeth-declared.sh +15 -15
- package/evals/acceptance/prove-capture-teeth.sh +11 -11
- package/evals/acceptance/test_kiro_harness.sh +1 -1
- package/evals/ci/antigaming-suite.sh +5 -0
- package/evals/ci/run-baseline.sh +65 -1
- package/evals/fixtures/flow-kit-repository/invalid-bad-dependency/flows/review.flow.json +26 -0
- package/evals/fixtures/flow-kit-repository/invalid-bad-dependency/kit.json +13 -0
- package/evals/fixtures/flow-kit-repository/valid-with-dependency/flows/review.flow.json +26 -0
- package/evals/fixtures/flow-kit-repository/valid-with-dependency/kit.json +13 -0
- package/evals/fixtures/hook-influence/cases.json +32 -0
- package/evals/fixtures/pull-work-provider/github-issues.json +6 -6
- package/evals/fixtures/trust-reconcile-exploits/fabricated-attestation.json +59 -0
- package/evals/fixtures/trust-reconcile-exploits/no-label-bypass.json +36 -0
- package/evals/fixtures/trust-reconcile-exploits/skip-assumed-bypass.json +59 -0
- package/evals/fixtures/trust-reconcile-exploits/status-misassertion.json +48 -0
- package/evals/fixtures/trust-reconcile-exploits/waived-command-check.json +44 -0
- package/evals/fixtures/trust-reconcile-mixed-bundle/mixed-bundle.json +159 -0
- package/evals/fixtures/trust-reconcile-ws3/ws3-bundle.json +920 -0
- package/evals/integration/test_actor_identity.sh +254 -0
- package/evals/integration/test_builder_step_producers.sh +33 -23
- package/evals/integration/test_bundle_install.sh +22 -16
- package/evals/integration/test_bundle_lifecycle.sh +11 -11
- package/evals/integration/test_captured_fail_reconciliation.sh +50 -50
- package/evals/integration/test_checkpoint_signing.sh +43 -0
- package/evals/integration/test_claim_lookup.sh +4 -4
- package/evals/integration/test_codex_hook_resolution.sh +114 -0
- package/evals/integration/test_command_log_concurrency.sh +8 -8
- package/evals/integration/test_command_log_fork_classification.sh +3 -3
- package/evals/integration/test_command_log_integrity.sh +16 -16
- package/evals/integration/test_console_learning_projection.sh +1 -1
- package/evals/integration/test_dual_emit_flow_step.sh +145 -0
- package/evals/integration/test_enforcer_expects_driven.sh +12 -12
- package/evals/integration/test_evidence_capture_hook.sh +14 -13
- package/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/evals/integration/test_flow_agents_statusline.sh +2 -2
- package/evals/integration/test_flow_kit_install_git.sh +52 -0
- package/evals/integration/test_flow_kit_repository.sh +2 -0
- package/evals/integration/test_flowdef_session_activation.sh +6 -6
- package/evals/integration/test_flowdef_union_floor_regression.sh +429 -0
- package/evals/integration/test_gate_bypass_chain.sh +52 -40
- package/evals/integration/test_gate_lockdown.sh +97 -73
- package/evals/integration/test_gate_review_inquiry_records.sh +3 -3
- package/evals/integration/test_goal_fit_escape_hatch.sh +10 -10
- package/evals/integration/test_goal_fit_ghost_session.sh +104 -0
- package/evals/integration/test_goal_fit_hook.sh +32 -32
- package/evals/integration/test_goal_fit_rederive.sh +9 -9
- package/evals/integration/test_hook_category_behaviors.sh +103 -0
- package/evals/integration/test_hook_influence_cases.sh +1 -0
- package/evals/integration/test_install_merge.sh +262 -1
- package/evals/integration/test_kit_identity_trust.sh +6 -6
- package/evals/integration/test_liveness_conflict_injection.sh +587 -0
- package/evals/integration/test_liveness_heartbeat.sh +677 -0
- package/evals/integration/test_liveness_verdict.sh +394 -0
- package/evals/integration/test_local_flow_kit_install.sh +15 -0
- package/evals/integration/test_phase_map_and_gate_claim.sh +63 -11
- package/evals/integration/test_promote_gate.sh +178 -0
- package/evals/integration/test_publish_delivery.sh +2 -2
- package/evals/integration/test_pull_work_liveness_preflight.sh +386 -0
- package/evals/integration/test_pull_work_provider.sh +2 -2
- package/evals/integration/test_reconcile_soundness.sh +4 -4
- package/evals/integration/test_resolvefirststep_security.sh +22 -0
- package/evals/integration/test_runtime_adapter_activation.sh +87 -18
- package/evals/integration/test_session_resume_roundtrip.sh +147 -0
- package/evals/integration/test_sidecar_field_preservation.sh +249 -0
- package/evals/integration/test_trust_reconcile.sh +2 -2
- package/evals/integration/test_trust_reconcile_manifest.sh +79 -0
- package/evals/integration/test_trust_reconcile_mixed_bundle.sh +96 -0
- package/evals/integration/test_trust_reconcile_negatives.sh +151 -0
- package/evals/integration/test_usage_feedback_global.sh +5 -5
- package/evals/integration/test_validate_artifacts_portability.sh +60 -0
- package/evals/integration/test_verify_cli.sh +2 -2
- package/evals/integration/test_veritas_governance_kit.sh +117 -0
- package/evals/integration/test_workflow_artifact_cleanup_audit.sh +26 -1
- package/evals/integration/test_workflow_artifacts.sh +33 -0
- package/evals/integration/test_workflow_sidecar_writer.sh +723 -74
- package/evals/integration/test_workflow_steering_hook.sh +175 -5
- package/evals/lib/codex-provider.sh +1 -1
- package/evals/lib/node.sh +19 -1
- package/evals/run.sh +22 -0
- package/evals/static/test_decisions.sh +150 -0
- package/evals/static/test_flowdef_codeowners_coverage.sh +56 -0
- package/evals/static/test_package.sh +19 -10
- package/evals/static/test_universal_bundles.sh +48 -3
- package/evals/static/test_workflow_skills.sh +41 -8
- package/kits/builder/flows/build.flow.json +3 -74
- package/kits/builder/flows/publish-learn.flow.json +90 -0
- package/kits/builder/kit.json +11 -0
- package/kits/builder/skills/builder-shape/SKILL.md +1 -1
- package/kits/builder/skills/deliver/SKILL.md +13 -11
- package/kits/builder/skills/design-probe/SKILL.md +4 -4
- package/kits/builder/skills/evidence-gate/SKILL.md +26 -1
- package/kits/builder/skills/execute-plan/SKILL.md +2 -2
- package/kits/builder/skills/fix-bug/SKILL.md +2 -0
- package/kits/builder/skills/gate-review/SKILL.md +6 -6
- package/kits/builder/skills/idea-to-backlog/SKILL.md +1 -1
- package/kits/builder/skills/learning-review/SKILL.md +7 -7
- package/kits/builder/skills/pickup-probe/SKILL.md +5 -4
- package/kits/builder/skills/plan-work/SKILL.md +27 -5
- package/kits/builder/skills/pull-work/SKILL.md +80 -5
- package/kits/builder/skills/release-readiness/SKILL.md +4 -4
- package/kits/builder/skills/review-work/SKILL.md +24 -1
- package/kits/builder/skills/tdd-workflow/SKILL.md +2 -0
- package/kits/builder/skills/verify-work/SKILL.md +8 -1
- package/kits/catalog.json +6 -0
- package/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +178 -0
- package/kits/veritas-governance/docs/README.md +75 -0
- package/kits/veritas-governance/fixtures/readiness/not-ready.readiness-report.json +4645 -0
- package/kits/veritas-governance/fixtures/readiness/ready.readiness-report.json +4403 -0
- package/kits/veritas-governance/flows/readiness-check.flow.json +35 -0
- package/kits/veritas-governance/kit.json +16 -0
- package/package.json +8 -4
- package/packaging/README.md +2 -2
- package/packaging/conformance/fixtures/config-protection--allow-read-state-json.json +20 -0
- package/packaging/conformance/fixtures/config-protection--block-write-state-json.json +20 -0
- package/packaging/conformance/fixtures/stop-goal-fit--block-bundle-disputed-claim.json +1 -1
- package/packaging/conformance/fixtures/stop-goal-fit--block-capture-contradicts-claimed-pass.json +1 -1
- package/packaging/manifest.json +9 -10
- package/schemas/decision-record.schema.json +109 -0
- package/schemas/workflow-evidence.schema.json +1 -1
- package/schemas/workflow-state.schema.json +5 -0
- package/scripts/README.md +8 -3
- package/scripts/check-content-boundary.cjs +1 -1
- package/scripts/check-decisions.cjs +356 -0
- package/scripts/ci/derive-claim-status.mjs +74 -0
- package/scripts/ci/trust-reconcile.js +436 -79
- package/scripts/git-status.sh +2 -2
- package/scripts/hooks/claude-telemetry-hook.js +37 -3
- package/scripts/hooks/codex-telemetry-hook.js +36 -2
- package/scripts/hooks/config-protection.js +102 -30
- package/scripts/hooks/evidence-capture.js +3 -3
- package/scripts/hooks/lib/actor-identity.js +368 -0
- package/scripts/hooks/lib/config-protection-remedies.js +69 -0
- package/scripts/hooks/lib/liveness-heartbeat.js +361 -0
- package/scripts/hooks/lib/liveness-policy.js +127 -0
- package/scripts/hooks/lib/liveness-read.js +105 -12
- package/scripts/hooks/lib/liveness-write.js +46 -0
- package/scripts/hooks/lib/local-artifact-paths.js +12 -6
- package/scripts/hooks/opencode-telemetry-hook.js +27 -1
- package/scripts/hooks/pi-telemetry-hook.js +27 -1
- package/scripts/hooks/stop-goal-fit.js +157 -26
- package/scripts/hooks/workflow-steering.js +77 -3
- package/scripts/install-codex-home.sh +138 -38
- package/scripts/statusline/flow-agents-statusline.js +2 -2
- package/src/cli/console-learning-projection.ts +3 -2
- package/src/cli/init.ts +101 -21
- package/src/cli/kit.ts +37 -6
- package/src/cli/public-api.test.mjs +58 -6
- package/src/cli/pull-work-provider.ts +1 -1
- package/src/cli/trust-bundle-policy-order.test.mjs +87 -0
- package/src/cli/usage-feedback.ts +3 -3
- package/src/cli/validate-hook-influence.ts +1 -0
- package/src/cli/validate-workflow-artifacts.ts +22 -6
- package/src/cli/veritas-readiness-adapter.test.mjs +267 -0
- package/src/cli/workflow-artifact-cleanup-audit.ts +35 -2
- package/src/cli/workflow-sidecar.ts +795 -71
- package/src/flow-kit/validate.ts +74 -1
- package/src/index.ts +6 -2
- package/src/lib/flow-resolver.ts +123 -55
- package/src/lib/local-artifact-root.ts +24 -5
- package/src/lib/workflow-learning-projection.ts +2 -2
- package/src/runtime-adapters.ts +61 -15
- package/src/tools/build-universal-bundles.ts +49 -16
- package/src/tools/generate-context-map.ts +10 -8
- package/src/tools/validate-source-tree.ts +23 -1
|
@@ -12,7 +12,7 @@ Classify gate fires and suspected misses from the session's `trust.bundle` by ca
|
|
|
12
12
|
- **Advisory-only**: proposes fixes, never applies them. No finding may instruct auto-application of any fix.
|
|
13
13
|
- Never writes to `scripts/hooks/` or any flow file.
|
|
14
14
|
- Reads the local `trust.bundle` file only. Does NOT fall back to `command-log.jsonl`, `.goal-fit-block-streak.json`, or `evidence.json` direct reads as primary inputs.
|
|
15
|
-
- If no `trust.bundle` is present at `.flow-agents/<slug>/trust.bundle`, reports `NOT_VERIFIED` and stops. Does not silently degrade to bespoke sidecar reads.
|
|
15
|
+
- If no `trust.bundle` is present at `.kontourai/flow-agents/<slug>/trust.bundle`, reports `NOT_VERIFIED` and stops. Does not silently degrade to bespoke sidecar reads.
|
|
16
16
|
- Routes all telemetry, `learning.json` writes, and correction routing through `learning-review`. Gate-review never calls `record-learning` directly.
|
|
17
17
|
- Reads `state.json` for lifecycle context only (phase, status). `state.json` is NOT a trust claim per ADR 0010.
|
|
18
18
|
- Reads `context/gate-awareness.md` for vocabulary alignment when available.
|
|
@@ -23,7 +23,7 @@ Classify gate fires and suspected misses from the session's `trust.bundle` by ca
|
|
|
23
23
|
|
|
24
24
|
## Inputs
|
|
25
25
|
|
|
26
|
-
- `trust.bundle` at `.flow-agents/<slug>/trust.bundle` (produced by ADR 0010 Phase 1 dual-write in `workflow-sidecar`).
|
|
26
|
+
- `trust.bundle` at `.kontourai/flow-agents/<slug>/trust.bundle` (produced by ADR 0010 Phase 1 dual-write in `workflow-sidecar`).
|
|
27
27
|
|
|
28
28
|
**Dependency**: this file is NOT present at `origin/main @ a9b8fd6`; it requires ADR 0010 Phase 1 to be built and merged (owned by `arch/goal-fit-gate-trust-bundle`). Do not begin execution until Phase 1 has landed or a fixture is agreed with that owner.
|
|
29
29
|
|
|
@@ -64,12 +64,12 @@ Classify gate fires and suspected misses from the session's `trust.bundle` by ca
|
|
|
64
64
|
| `stale` | Claim data is outdated; gate had stale input. |
|
|
65
65
|
| `unknown` | No event found; claim was never evaluated. |
|
|
66
66
|
|
|
67
|
-
- `state.json` at `.flow-agents/<slug>/state.json` (lifecycle context; not a trust input).
|
|
67
|
+
- `state.json` at `.kontourai/flow-agents/<slug>/state.json` (lifecycle context; not a trust input).
|
|
68
68
|
- Optional: seeded fixture `trust.bundle` path for testing before Phase 1 produces real bundles.
|
|
69
69
|
|
|
70
70
|
## Artifact Contract
|
|
71
71
|
|
|
72
|
-
Write the following artifacts under `.flow-agents/<slug>/`:
|
|
72
|
+
Write the following artifacts under `.kontourai/flow-agents/<slug>/`:
|
|
73
73
|
|
|
74
74
|
### `<slug>--gate-review.md`
|
|
75
75
|
|
|
@@ -161,7 +161,7 @@ Cross-reference with `state.json` phase at the time of the block to confirm the
|
|
|
161
161
|
|
|
162
162
|
### Step 1 — Locate trust.bundle
|
|
163
163
|
|
|
164
|
-
Resolve `.flow-agents/<slug>/trust.bundle`. The slug is the most recent active session (by `current.json` or `state.json` newest-mtime). If absent, surface the blocker:
|
|
164
|
+
Resolve `.kontourai/flow-agents/<slug>/trust.bundle`. The slug is the most recent active session (by `current.json` or `state.json` newest-mtime). If absent, surface the blocker:
|
|
165
165
|
|
|
166
166
|
```
|
|
167
167
|
[gate-review] trust.bundle absent — NOT_VERIFIED. Build ADR 0010 Phase 1 first.
|
|
@@ -209,7 +209,7 @@ Pass the `gate-review.inquiries.json` path as additional reviewer notes to `lear
|
|
|
209
209
|
|
|
210
210
|
Example invocation note:
|
|
211
211
|
```
|
|
212
|
-
gate-review InquiryRecords at .flow-agents/<slug>/gate-review.inquiries.json:
|
|
212
|
+
gate-review InquiryRecords at .kontourai/flow-agents/<slug>/gate-review.inquiries.json:
|
|
213
213
|
- <N> record(s): calibration counts
|
|
214
214
|
- gate fired: <true/false>
|
|
215
215
|
- calibration: correct=<n>, false_block=<n>, missed_block=<n>
|
|
@@ -23,7 +23,7 @@ Convert raw ideas into shaped, prioritized, executable backlog without starting
|
|
|
23
23
|
|
|
24
24
|
## Artifact Contract
|
|
25
25
|
|
|
26
|
-
Create or update `.flow-agents/<slug>/<slug>--idea-to-backlog.md` with:
|
|
26
|
+
Create or update `.kontourai/flow-agents/<slug>/<slug>--idea-to-backlog.md` with:
|
|
27
27
|
|
|
28
28
|
- `source_ideas`: raw inputs and dedupe links
|
|
29
29
|
- `idea_inventory`: one record per distinct idea, classification, outcome, and reason
|
|
@@ -14,7 +14,7 @@ Turn delivery outcomes into durable learning and follow-up work.
|
|
|
14
14
|
- Capture facts, decisions, and follow-up issues separately.
|
|
15
15
|
- Feed actionable changes back to `idea-to-backlog`, GitHub issues, tests, docs, or knowledge.
|
|
16
16
|
- Use `knowledge-capture` or `observe` when the learning should persist beyond the repo.
|
|
17
|
-
- Compare long-lived docs against the local `.flow-agents/<slug>/` plan and the final acceptance artifact so implementation intent is not lost after merge.
|
|
17
|
+
- Compare long-lived docs against the local `.kontourai/flow-agents/<slug>/` plan and the final acceptance artifact so implementation intent is not lost after merge.
|
|
18
18
|
- Treat `learning-review` as the terminal closeout decision point for correction telemetry. Compare intended behavior to observed behavior before writing `learning.json`, then record either `correction.needed: false` for a clean run or `correction.needed: true` for a mismatch.
|
|
19
19
|
|
|
20
20
|
## Inputs
|
|
@@ -23,7 +23,7 @@ Turn delivery outcomes into durable learning and follow-up work.
|
|
|
23
23
|
|
|
24
24
|
## Artifact Contract
|
|
25
25
|
|
|
26
|
-
Create or update `.flow-agents/<slug>/<slug>--learning-review.md` with:
|
|
26
|
+
Create or update `.kontourai/flow-agents/<slug>/<slug>--learning-review.md` with:
|
|
27
27
|
|
|
28
28
|
- `scope`: delivered work, issue/PR/release links, dates
|
|
29
29
|
- `outcomes`: expected vs observed behavior and signals
|
|
@@ -39,7 +39,7 @@ Create or update `.flow-agents/<slug>/<slug>--learning-review.md` with:
|
|
|
39
39
|
When the repository provides `npm run workflow:sidecar --`, also write `learning.json` with:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npm run workflow:sidecar -- record-learning .flow-agents/<slug> \
|
|
42
|
+
npm run workflow:sidecar -- record-learning .kontourai/flow-agents/<slug> \
|
|
43
43
|
--status learned \
|
|
44
44
|
--record-json '{"id":"...","source_refs":["release.json"],"outcome":"success","facts":["..."],"interpretation":"...","routing":[{"target":"none","action":"No follow-up required after intended-vs-observed closeout.","status":"completed"}],"correction":{"needed":false,"evidence":"Acceptance, release, docs promotion, and learning closeout behaved as intended."}}' \
|
|
45
45
|
--summary "..."
|
|
@@ -112,21 +112,21 @@ After `learning.json` is written and the learning verdict is `LEARNED` or `FOLLO
|
|
|
112
112
|
**Claim 1 — Decision evidence** (durable decisions from the build are recorded):
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
|
-
npm run workflow:sidecar -- record-gate-claim .flow-agents/<slug> \
|
|
115
|
+
npm run workflow:sidecar -- record-gate-claim .kontourai/flow-agents/<slug> \
|
|
116
116
|
--expectation decision-evidence \
|
|
117
117
|
--status pass \
|
|
118
118
|
--summary "Build decisions recorded: <decision-count> decisions captured, correction.<needed> recorded." \
|
|
119
|
-
--evidence-ref-json '{"kind":"artifact","file":".flow-agents/<slug>/learning.json","summary":"learning.json with decisions and correction state."}'
|
|
119
|
+
--evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/<slug>/learning.json","summary":"learning.json with decisions and correction state."}'
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
**Claim 2 — Learning evidence** (learnings from delivery are recorded for future work):
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
npm run workflow:sidecar -- record-gate-claim .flow-agents/<slug> \
|
|
125
|
+
npm run workflow:sidecar -- record-gate-claim .kontourai/flow-agents/<slug> \
|
|
126
126
|
--expectation learning-evidence \
|
|
127
127
|
--status pass \
|
|
128
128
|
--summary "Learning evidence captured: <outcome> outcome, facts recorded, routing complete." \
|
|
129
|
-
--evidence-ref-json '{"kind":"artifact","file":".flow-agents/<slug>/learning.json","summary":"learning.json with outcomes, facts, and routing."}'
|
|
129
|
+
--evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/<slug>/learning.json","summary":"learning.json with outcomes, facts, and routing."}'
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
Record both claims immediately after `record-learning` succeeds and artifact validation passes. Use `--status fail` when `record-learning` fails or when learning cannot be captured (verdict `BLOCKED`). Use `--status not_verified` only when the session has no active Builder Kit flow step.
|
|
@@ -49,6 +49,7 @@ Challenge the selected work against the repository before planning:
|
|
|
49
49
|
- Challenge glossary conflicts immediately: if a user or issue uses a term differently than `CONTEXT.md`, ask which meaning is authoritative before planning.
|
|
50
50
|
- Discuss concrete scenarios when boundaries are fuzzy, especially around ownership, provider state, workflow gates, and stop-short behavior.
|
|
51
51
|
- Check whether the selected work is still ready after WIP, conflicts, blockers, dependency freshness, and expected modified files are considered.
|
|
52
|
+
- If the pull-work artifact flags the selected item `reclaimable`, treat the recorded opt-in as a decision to re-confirm (not silently accept) when material drift or time has passed since pull-work's preflight ran.
|
|
52
53
|
- Keep downstream issues and non-goals out of scope unless they are explicit contract consumers for the selected work.
|
|
53
54
|
- Ask one question at a time when a decision is needed, include a recommended answer, and record the answer immediately.
|
|
54
55
|
- Record unresolved questions as blockers unless the user or orchestrator explicitly accepts proceeding with the gap.
|
|
@@ -91,21 +92,21 @@ When the Planning Gate passes, record the two gate claims for the Builder Kit `d
|
|
|
91
92
|
**Claim 1 — Pickup readiness** (probe passed, goal fit and scope confirmed):
|
|
92
93
|
|
|
93
94
|
```bash
|
|
94
|
-
npm run workflow:sidecar -- record-gate-claim .flow-agents/<slug> \
|
|
95
|
+
npm run workflow:sidecar -- record-gate-claim .kontourai/flow-agents/<slug> \
|
|
95
96
|
--expectation pickup-probe-readiness \
|
|
96
97
|
--status pass \
|
|
97
98
|
--summary "Pickup probe passed: goal fit confirmed, blockers checked, dependencies reviewed, acceptance criteria verified." \
|
|
98
|
-
--evidence-ref-json '{"kind":"artifact","file":".flow-agents/<slug>/<slug>--pull-work.md","summary":"Pull-work artifact recording probe status, scope, and planning readiness."}'
|
|
99
|
+
--evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/<slug>/<slug>--pull-work.md","summary":"Pull-work artifact recording probe status, scope, and planning readiness."}'
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
**Claim 2 — Probe decisions captured** (decisions, accepted gaps, and planning readiness are recorded):
|
|
102
103
|
|
|
103
104
|
```bash
|
|
104
|
-
npm run workflow:sidecar -- record-gate-claim .flow-agents/<slug> \
|
|
105
|
+
npm run workflow:sidecar -- record-gate-claim .kontourai/flow-agents/<slug> \
|
|
105
106
|
--expectation probe-decisions-or-accepted-gaps \
|
|
106
107
|
--status pass \
|
|
107
108
|
--summary "Probe decisions recorded: <decision-count> decisions, <gap-count> accepted gaps. Planning readiness: <ready|accepted_gap_ready>." \
|
|
108
|
-
--evidence-ref-json '{"kind":"artifact","file":".flow-agents/<slug>/<slug>--pull-work.md","summary":"Pull-work artifact with decisions, accepted gaps, and planning handoff."}'
|
|
109
|
+
--evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/<slug>/<slug>--pull-work.md","summary":"Pull-work artifact with decisions, accepted gaps, and planning handoff."}'
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
Record both claims together immediately when the gate passes. Use `--status fail` when the gate fails (unresolved blocker or decision gap). Use `--status not_verified` only when the session has no active flow step.
|
|
@@ -98,11 +98,11 @@ The `tool-planner` prompt context must include the latest-base confirmation and
|
|
|
98
98
|
|
|
99
99
|
## Workflow
|
|
100
100
|
|
|
101
|
-
1. Create session file in `.flow-agents/<slug>/` if one wasn't provided:
|
|
101
|
+
1. Create session file in `.kontourai/flow-agents/<slug>/` if one wasn't provided:
|
|
102
102
|
- Filename: `<slug>--plan-work.md`
|
|
103
103
|
- `status: planning`, `type: plan-work`
|
|
104
|
-
- Create or update `state.json`
|
|
105
|
-
- use `npm run workflow:sidecar -- ensure-session --source-request ... --summary ... --criterion ...` when the repository provides it; this also writes `.flow-agents/current.json`
|
|
104
|
+
- Create or update `state.json` (phase `planning`) via `npm run workflow:sidecar -- init-plan`/`ensure-session` — never through a direct Write/Edit tool call (`config-protection.js` blocks that by design)
|
|
105
|
+
- use `npm run workflow:sidecar -- ensure-session --source-request ... --summary ... --criterion ...` when the repository provides it; this also writes `.kontourai/flow-agents/current.json`
|
|
106
106
|
- **Builder Kit build flow**: add `--flow-id builder.build` to the `ensure-session` call when `plan-work` is invoked from `deliver`, from the Builder Kit `build` flow, or from a pick-up-and-build request after `pull-work`. This activates the FlowDefinition-driven path so producers fire and gates enforce on builder.* claims. Do NOT add `--flow-id` for direct/ad-hoc primitive `plan-work` invocations that are not part of a builder-flow.
|
|
107
107
|
2. Delegate to `tool-planner`:
|
|
108
108
|
```
|
|
@@ -127,7 +127,7 @@ The `tool-planner` prompt context must include the latest-base confirmation and
|
|
|
127
127
|
- if task-to-acceptance mapping is unclear, send the planner feedback before presenting the plan as ready
|
|
128
128
|
4. Read the plan artifact
|
|
129
129
|
5. Update session file: paste plan summary into `## Plan`, set `status: planned`
|
|
130
|
-
6. Update `state.json`
|
|
130
|
+
6. Update `state.json` (`status: planned`, phase `planning`, next action) via `npm run workflow:sidecar -- advance-state` — never through a direct Write/Edit tool call (`config-protection.js` blocks that by design)
|
|
131
131
|
7. Present the plan to the user
|
|
132
132
|
8. If the user wants changes, re-delegate to tool-planner with feedback
|
|
133
133
|
|
|
@@ -177,12 +177,34 @@ Structured plan from tool-planner (pasted from artifact).
|
|
|
177
177
|
Copied from the plan artifact. This is the stop condition for delivery.
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
+
`<branch>` is the branch recorded in `state.json`'s `branch` field (`ensure-session` derives `agent/<actor>/<slug>`; an explicit `--branch` flag overrides on a new session). `ensure-session` only records the name — creating and checking out the actual git branch/worktree remains this skill's responsibility.
|
|
181
|
+
|
|
180
182
|
## Output
|
|
181
183
|
|
|
182
|
-
- Session file in `.flow-agents/<slug>/` with status `planned`
|
|
184
|
+
- Session file in `.kontourai/flow-agents/<slug>/` with status `planned`
|
|
183
185
|
- Plan artifact: `<session-basename>-plan.md`
|
|
184
186
|
- Structured sidecars: `state.json`, `acceptance.json`, and `handoff.json`
|
|
185
187
|
- The plan artifact is the source of truth — tool-worker agents read it directly
|
|
186
188
|
- Plan artifact follows `context/contracts/planning-contract.md`
|
|
187
189
|
|
|
188
190
|
{context?}
|
|
191
|
+
|
|
192
|
+
## Ad-hoc Direct Entry (Planning-Only or Non-`pull-work` Sessions)
|
|
193
|
+
|
|
194
|
+
`ensure-session --flow-id <id>` without `--step-id` defaults `active_step_id` to the
|
|
195
|
+
flow's FIRST step (`pull-work` for `builder.build`). For a session that legitimately
|
|
196
|
+
enters mid-flow — e.g. planning directly from a portfolio work item without a
|
|
197
|
+
`pull-work`/pickup artifact — pass the sanctioned override:
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
npm run workflow:sidecar -- ensure-session \
|
|
201
|
+
--flow-id builder.build --task-slug <slug> --step-id plan \
|
|
202
|
+
[--ad-hoc-reason "planning a directly-issued work item; no pull-work artifact"]
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
When `--step-id` names a step other than the flow's first step, `ensure-session` records
|
|
206
|
+
`ad_hoc_entry: true` + `ad_hoc_reason` in `current.json`. This is the sanctioned way to
|
|
207
|
+
enter a flow mid-stream: the explicit marker lets `stop-goal-fit` / `gate-review`
|
|
208
|
+
distinguish an intentional direct entry from a stale or mis-stamped `active_step_id`,
|
|
209
|
+
instead of silently defaulting to the first step and looking like a normal `pull-work`
|
|
210
|
+
start.
|
|
@@ -29,14 +29,17 @@ Select ready backlog work and prepare a bounded execution handoff without implem
|
|
|
29
29
|
- Repository or working directory.
|
|
30
30
|
- Optional labels, milestone, project board, assignee, or priority filter.
|
|
31
31
|
- Optional WIP limit or current in-progress context.
|
|
32
|
-
- Existing `.flow-agents/<slug>/` artifacts, PRs, and CI/review queues.
|
|
32
|
+
- Existing `.kontourai/flow-agents/<slug>/` artifacts, PRs, and CI/review queues.
|
|
33
33
|
|
|
34
34
|
## Artifact Contract
|
|
35
35
|
|
|
36
|
-
Create or update `.flow-agents/<slug>/<slug>--pull-work.md` with:
|
|
36
|
+
Create or update `.kontourai/flow-agents/<slug>/<slug>--pull-work.md` with:
|
|
37
37
|
|
|
38
38
|
- `board_snapshot`: filters, issue list, labels, milestone/provider milestone state, project fields, state, blockers
|
|
39
39
|
- `wip_assessment`: active work, reviews, verification, CI remediation, with personal WIP separated from global conflict context
|
|
40
|
+
- `liveness_preflight`: per-candidate `{subjectId, state: held|reclaimable|free|mine, holder_actor?, status_raw}` plus `self_actor`/`self_actor_source`, computed via `liveness status --json` + `liveness whoami --json`; `self_actor` is captured exactly once per pull-work pass and pinned for reuse (see "1a. Liveness Selection Preflight" and "Liveness Claim On Selection" — never re-derived per claim call); this is the liveness-only projection of ADR 0021 §1's join, pending #290's assignment dimension
|
|
41
|
+
- `reclaimable_override`: recorded only when a `reclaimable` (stale) candidate is selected, or when `--force`/an explicit user instruction overrides a `held` exclusion — the explicit opt-in decision and its stated reason (see "1a. Liveness Selection Preflight")
|
|
42
|
+
- `liveness_claim`: per selected item, `{subjectId, actor, emitted_at, ttl_seconds}`; on any claim-emit failure, `{skipped: <stderr reason>}` instead — fail-open (never block selection on a liveness-emit failure) but never silent: the skip reason is also surfaced in pull-work's user-facing output, and an unresolved-actor failure additionally names the remediation (`--actor <id>` / `FLOW_AGENTS_ACTOR=<id>` / a supported runtime), matching ADR 0012; also carries an optional `post_claim_conflict: {other_actor, detected_at}` when the post-claim re-check (see "Post-Claim Conflict Re-check") detects a double-hold
|
|
40
43
|
- `my_active_work`: local worktrees, dirty branches, open PRs by the current user, active sidecars, and in-flight review/verification/release work owned by the current user
|
|
41
44
|
- `shepherding_candidates`: personal PRs, worktrees, or sidecars that should be reviewed, fixed, published, merged, abandoned, or cleaned before starting more work
|
|
42
45
|
- `stale_worktrees`: worktrees with no open PR, no recent activity, merged/abandoned branches, or unclear ownership that need an explicit keep/remove decision
|
|
@@ -111,6 +114,41 @@ Missing `planned_base_sha` is not fresh. Record it as an explicit `NOT_VERIFIED`
|
|
|
111
114
|
|
|
112
115
|
Return vague work to `idea-to-backlog` instead of inventing scope.
|
|
113
116
|
|
|
117
|
+
### 1a. Liveness Selection Preflight
|
|
118
|
+
|
|
119
|
+
Resolve the current actor once per `pull-work` pass and pin it for reuse:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npm run workflow:sidecar -- liveness whoami --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Capture the returned `actor` value as `self_actor` (and its `source` as `self_actor_source`) exactly once per pass. Reuse this pinned `self_actor` value explicitly via `--actor <self_actor>` on every subsequent `liveness claim` call in the same pass (see "Liveness Claim On Selection" below) — never re-derive the actor mid-pass, since ancestry/session-based resolution could otherwise resolve to a different value across separate calls within the same pass and silently defeat the "who am I" pinning this preflight depends on.
|
|
126
|
+
|
|
127
|
+
Read the full liveness stream once per pass (omit `--subject` to get every row):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm run workflow:sidecar -- liveness status --json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
For each ready candidate, derive `subjectId` via:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm run workflow:sidecar -- resolve-slug <owner>/<repo>#<issue-number>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
then group all rows for that `subjectId` by subject (classify per subject, not per row) and classify in this precedence order, reading each row's raw `status` field (never `label`):
|
|
140
|
+
|
|
141
|
+
1. a `verified` row for an actor other than self ⇒ `held`, excluded from the ready set by default, even when a `verified` row for the resolved self actor also exists on the same subject — that combination is a double-hold: surface it as `held` plus an explicit conflict warning (per ADR 0012 §4 detection: "a false-stale double-hold ... is detected ... not prevented"), never silently resolve it to `mine`.
|
|
142
|
+
2. else, a `verified` row for the resolved self actor ⇒ `mine`: hand to `### 2. Enforce WIP And Shepherding`'s existing personal-WIP logic; do not re-offer as new, do not exclude as held-by-other.
|
|
143
|
+
3. else, a `stale` row (any actor) ⇒ `reclaimable`: offered, flagged, with a warning; selecting it requires an explicit recorded opt-in (record in `reclaimable_override`, and/or `alignment_questions`), never a silent normal pick.
|
|
144
|
+
4. else (a `revoked`-only row, a `superseded` row, or no row at all) ⇒ `free`, offered normally — except a `superseded` row is surfaced but never auto-selected (full takeover semantics are #294; this is an accepted gap, not silently ignored).
|
|
145
|
+
|
|
146
|
+
An explicit user instruction to proceed despite a `held` or `reclaimable` classification (`--force`, "take it anyway", equivalent) overrides the exclusion/opt-in requirement; the override and its stated reason must be recorded in the artifact (`liveness_preflight`, `reclaimable_override`, and/or `priority_rationale`).
|
|
147
|
+
|
|
148
|
+
This preflight computes the **liveness-only** projection of ADR 0021 §1's `assignment ⋈ liveness` join. The assignment dimension is #290's `AssignmentProvider` (durable GitHub-side claim); until it lands, assignment is treated as always-unassigned, which ADR 0021 §1's own table shows is safe because staleness — not assignment — is what excludes.
|
|
149
|
+
|
|
150
|
+
`liveness claim`/`status`/`whoami` read/write the local runtime liveness stream, never GitHub issue/label/assignee state — this is not a provider mutation, and the existing no-provider-mutation rule (see below) is unchanged by this slice. #290 will add the one narrow, audited GitHub-side mutation that pairs with this liveness emit.
|
|
151
|
+
|
|
114
152
|
### 2. Enforce WIP And Shepherding
|
|
115
153
|
|
|
116
154
|
Before selecting new work, check whether review, verification, release, or CI remediation is congested. Separate the current user's active work from global conflict context.
|
|
@@ -119,7 +157,7 @@ Personal WIP scan:
|
|
|
119
157
|
|
|
120
158
|
- Inspect local worktrees and branches for dirty state, unpublished commits, merged branches, abandoned branches, and unclear ownership.
|
|
121
159
|
- Inspect open PRs authored by the current user and record review/check state, requested changes, mergeability, and whether the PR needs shepherding.
|
|
122
|
-
- Inspect active `.flow-agents/<slug>/` sidecars owned by the current user or current session, especially `planning`, `planned`, `in_progress`, `verifying`, `needs_decision`, `not_verified`, `failed`, and `blocked`.
|
|
160
|
+
- Inspect active `.kontourai/flow-agents/<slug>/` sidecars owned by the current user or current session, especially `planning`, `planned`, `in_progress`, `verifying`, `needs_decision`, `not_verified`, `failed`, and `blocked`.
|
|
123
161
|
- Classify personal items into `my_active_work`, `shepherding_candidates`, `stale_worktrees`, and `open_prs_by_me`.
|
|
124
162
|
|
|
125
163
|
Global conflict scan:
|
|
@@ -187,6 +225,43 @@ Use these compact examples as the expected artifact shape when selecting or reje
|
|
|
187
225
|
- **dogfood-alpha implementation work**: `selected_scope`: single-item implementation slice in the dogfood-alpha milestone; `priority_rationale`: high delivery alignment and unlocks product dogfood evidence, but only selected if dependencies are closed or explicitly accepted; `dependencies`: list blocked-by issues, required artifacts, and pickup Probe freshness; `wip_conflict_notes`: require worktree isolation when implementation overlaps active files or release lanes; `grouping_check`: Work Item Group only when one item hard-blocks the implementation and the dependency sequence is part of the same acceptance signal; `alignment_questions`: ask the narrow scope question before `plan-work` if the issue could expand into provider adapters or runtime orchestration.
|
|
188
226
|
- **blocked cross-product dependency**: `selected_scope`: no implementation selection; `priority_rationale`: defer because a higher-priority item in another product/repo is blocked by an unresolved dependency or missing provider state; `dependencies`: name the blocker, owner/repo when known, and freshness check; `wip_conflict_notes`: record any release-lane or provider-state conflict as the reason to stop; `grouping_check`: unsafe-group unless explicit dependency sequencing and shared acceptance justify a bundle; `alignment_questions`: ask whether to shepherd/unblock the dependency, return to shaping, or choose the next ready independent item.
|
|
189
227
|
|
|
228
|
+
### Liveness Claim On Selection
|
|
229
|
+
|
|
230
|
+
Once `selected_item_ids` is finalized at the end of `### 3. Select Work`, before handoff to `plan-work`, for each selected item run:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
npm run workflow:sidecar -- liveness claim <subjectId> --actor <self_actor>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
using the same `subjectId` computed via `resolve-slug` during the preflight, and the same pinned `self_actor` captured once from `liveness whoami --json` at the start of this pass (`### 1a. Liveness Selection Preflight`) — always pass `--actor <self_actor>` explicitly on every claim in this pass; never a fresh derivation per claim call.
|
|
237
|
+
|
|
238
|
+
Record the result in `liveness_claim` as `{subjectId, actor, emitted_at, ttl_seconds}`. On any claim-emit failure (non-zero exit, unresolved actor, or liveness disabled/unavailable), record `{skipped: <stderr reason>}` in `liveness_claim` instead — fail-open, never block selection on a liveness-emit failure — and also surface that skip reason in pull-work's user-facing output; never silent. When the failure is specifically an unresolved-actor failure, additionally name the remediation (`--actor <id>` / `FLOW_AGENTS_ACTOR=<id>` / a supported runtime), matching `liveness claim`'s own error message.
|
|
239
|
+
|
|
240
|
+
### Post-Claim Conflict Re-check
|
|
241
|
+
|
|
242
|
+
After emitting claims for the selected item(s) above, re-read liveness status for those same subjects:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
npm run workflow:sidecar -- liveness status --json --subject <subjectId>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
If another actor's fresh (`verified`) claim now coexists with this session's own just-emitted claim on the same subject — a double-hold, per ADR 0012 §4 ("a false-stale double-hold (two fresh claims on one subject) is detected ... via Hachure `conflictRules`/`conflictedClaims`, not prevented") — surface the conflict prominently in the user-facing output and instruct the user to coordinate before proceeding; do not silently continue as if the selection were exclusive. Record the detected conflict in `liveness_claim`'s `post_claim_conflict` field.
|
|
249
|
+
|
|
250
|
+
When a double-hold is detected, immediately run the deterministic tiebreaker using the same pinned `self_actor` and the same `subjectId` already in scope:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
npm run workflow:sidecar -- liveness verdict <subjectId> --json
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
`liveness verdict` is a read-only, lock-free CLI action that computes `{subjectId, winner, losers, reason, holders}` as a pure function of the shared liveness stream: among the subject's currently-fresh claim holders, the one whose current `claim` event has the earliest `at` wins; an exact-timestamp tie breaks by ascending actor-id string comparison (`reason: "tie-actor-lexicographic"`) — the SAME verdict for the SAME stream state regardless of which actor invokes it.
|
|
257
|
+
|
|
258
|
+
Branch on the returned `winner.actor`:
|
|
259
|
+
|
|
260
|
+
- If `winner.actor !== self_actor`, this session is the loser: immediately run `npm run workflow:sidecar -- liveness release <subjectId> --actor <self_actor>`, extend `post_claim_conflict` with `{verdict_reason, winner_actor, conceded: true}`, and return to `### 3. Select Work` to reselect within the same `pull-work` pass — excluding the just-released subject — before any handoff to `plan-work`.
|
|
261
|
+
- If `winner.actor === self_actor`, this session wins: record the verdict for transparency (`{verdict_reason, winner_actor: self_actor, conceded: false}`) in `post_claim_conflict` and proceed normally; do not release.
|
|
262
|
+
|
|
263
|
+
Honesty note: this re-check narrows, but does not close, the read-then-write race between the preflight's read and the claim's write. The verdict-and-release loop above closes the "detected but advisory-only" gap ADR 0012 §4 names for THIS session's own double-hold — the loser deterministically concedes and re-selects within the same pass, a new convergence guarantee this slice adds — but it still does not provide true mutual exclusion across the read-then-write race window itself; that residual is unchanged from before. True mutual exclusion arrives with the provider assignment lease (#290) and the `verify-hold` publish gate (#293).
|
|
264
|
+
|
|
190
265
|
### 4. Anchor Check
|
|
191
266
|
|
|
192
267
|
Before planning, restate:
|
|
@@ -298,11 +373,11 @@ When the Pickup Gate passes and work is selected (not just a shepherding scan or
|
|
|
298
373
|
Use the `selected_item_ids` as the evidence artifact ref and confirm that scope and acceptance criteria are present in the pull-work artifact:
|
|
299
374
|
|
|
300
375
|
```bash
|
|
301
|
-
npm run workflow:sidecar -- record-gate-claim .flow-agents/<slug> \
|
|
376
|
+
npm run workflow:sidecar -- record-gate-claim .kontourai/flow-agents/<slug> \
|
|
302
377
|
--expectation selected-work \
|
|
303
378
|
--status pass \
|
|
304
379
|
--summary "Selected <work-item-ref>: scope clear, acceptance criteria present." \
|
|
305
|
-
--evidence-ref-json '{"kind":"artifact","file":".flow-agents/<slug>/<slug>--pull-work.md","summary":"Pull-work artifact with selected_item_ids, scope, and acceptance criteria."}'
|
|
380
|
+
--evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/<slug>/<slug>--pull-work.md","summary":"Pull-work artifact with selected_item_ids, scope, and acceptance criteria."}'
|
|
306
381
|
```
|
|
307
382
|
|
|
308
383
|
Use `--status fail` when the gate fails (blocker recorded but no selection made). Use `--status not_verified` only when the session has no active flow step (non-Builder-Kit usage).
|
|
@@ -28,7 +28,7 @@ Release Readiness is not Evidence Gate. Evidence Gate decides whether completed
|
|
|
28
28
|
|
|
29
29
|
## Artifact Contract
|
|
30
30
|
|
|
31
|
-
Create or update `.flow-agents/<slug>/<slug>--release-readiness.md` with:
|
|
31
|
+
Create or update `.kontourai/flow-agents/<slug>/<slug>--release-readiness.md` with:
|
|
32
32
|
|
|
33
33
|
- `release_scope`: work included, excluded, issue/provider-change links
|
|
34
34
|
- `evidence_reference`: evidence artifact, verdict, residual risks
|
|
@@ -37,13 +37,13 @@ Create or update `.flow-agents/<slug>/<slug>--release-readiness.md` with:
|
|
|
37
37
|
- `rollback_plan`: trigger, steps, owner, expected recovery signal
|
|
38
38
|
- `observability_plan`: metrics, logs, traces, alerts, dashboards
|
|
39
39
|
- `post_deploy_checks`: checks, commands, URLs, timing, expected signals
|
|
40
|
-
- `final_acceptance_docs`: long-lived docs updated, archived `.flow-agents/<slug>/` links, and deferred docs follow-ups
|
|
40
|
+
- `final_acceptance_docs`: long-lived docs updated, archived `.kontourai/flow-agents/<slug>/` links, and deferred docs follow-ups
|
|
41
41
|
- `decision`: MERGE, RELEASE, DEPLOY, HOLD, or ROLLBACK_REQUIRED
|
|
42
42
|
|
|
43
43
|
When the repository provides `npm run workflow:sidecar --`, also write `release.json` with:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npm run workflow:sidecar -- record-release .flow-agents/<slug> \
|
|
46
|
+
npm run workflow:sidecar -- record-release .kontourai/flow-agents/<slug> \
|
|
47
47
|
--decision merge \
|
|
48
48
|
--scope "..." \
|
|
49
49
|
--evidence-ref evidence.json \
|
|
@@ -108,7 +108,7 @@ When CI has passed and merge/release acceptance is clear, require a docs decisio
|
|
|
108
108
|
|
|
109
109
|
- update long-lived docs with what changed, how to use it, and important why/how decisions; or
|
|
110
110
|
- record why no durable docs are needed; and
|
|
111
|
-
- link back to the archived `.flow-agents/<slug>/` plan/session artifact for implementation history.
|
|
111
|
+
- link back to the archived `.kontourai/flow-agents/<slug>/` plan/session artifact for implementation history.
|
|
112
112
|
|
|
113
113
|
## Gates
|
|
114
114
|
|
|
@@ -48,7 +48,7 @@ If a fix is needed, report it as a finding. The orchestrator routes it back to e
|
|
|
48
48
|
|
|
49
49
|
## Input
|
|
50
50
|
|
|
51
|
-
- Session file path in `.flow-agents/<slug>/` when available
|
|
51
|
+
- Session file path in `.kontourai/flow-agents/<slug>/` when available
|
|
52
52
|
- Plan artifact or implementation summary
|
|
53
53
|
- Modified files from execution progress or `git diff --name-only`
|
|
54
54
|
- Project standards, especially `context/code-review-standards.md` when present
|
|
@@ -85,6 +85,29 @@ package-registry behavior, update dependencies, or install scanners. If the
|
|
|
85
85
|
required dependency review cannot run, record the dependency lane as
|
|
86
86
|
`not_verified`.
|
|
87
87
|
|
|
88
|
+
For multi-repo or cross-product work, dependency review must preserve the full
|
|
89
|
+
scope. Before delegating, enumerate every affected repo/package-manager root and
|
|
90
|
+
record one status per root:
|
|
91
|
+
|
|
92
|
+
- `pass`: dependency review ran and found no blocking issue
|
|
93
|
+
- `fail`: dependency review ran and found a blocking advisory, version, or
|
|
94
|
+
lockfile issue
|
|
95
|
+
- `skip_no_manifest`: the root has no supported dependency manifest
|
|
96
|
+
- `not_verified`: review could not run or the result is unavailable
|
|
97
|
+
|
|
98
|
+
Do not narrow the dependency lane to only roots that failed build/test. If the
|
|
99
|
+
work changed shared conventions, generated artifact paths, install scripts, CI,
|
|
100
|
+
or workspace-wide guidance, the dependency review summary must say which product
|
|
101
|
+
roots were included and which were out of scope.
|
|
102
|
+
|
|
103
|
+
External advisory/audit services can disclose private dependency metadata. Before
|
|
104
|
+
running tools such as `npm audit`, registry lookups, or vendor advisory APIs,
|
|
105
|
+
record whether the user explicitly approved that disclosure for the affected
|
|
106
|
+
roots. If approval is absent, rejected, or too ambiguous for the local execution
|
|
107
|
+
policy, keep local inventory evidence and mark the external-audit portion
|
|
108
|
+
`not_verified` with the approval/privacy blocker. Do not convert that blocker
|
|
109
|
+
into a clean pass.
|
|
110
|
+
|
|
88
111
|
## IaC/Policy Review Triggers
|
|
89
112
|
|
|
90
113
|
Run security and configured IaC/policy review when modified files touch
|
|
@@ -137,4 +137,6 @@ coverage_target: 80
|
|
|
137
137
|
- iteration 1: RED ✓, GREEN ✓, REFACTOR ✓, coverage 85%
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
`<branch>` is the branch recorded in `state.json`'s `branch` field (`ensure-session` derives `agent/<actor>/<slug>`; an explicit `--branch` flag overrides on a new session). `ensure-session` only records the name — creating and checking out the actual git branch/worktree remains this skill's responsibility.
|
|
141
|
+
|
|
140
142
|
{context?}
|
|
@@ -39,7 +39,7 @@ This skill owns orchestration and routing. The verification contract owns phases
|
|
|
39
39
|
|
|
40
40
|
## Input
|
|
41
41
|
|
|
42
|
-
- **Session file path**: the session file in `.flow-agents/<slug>/` (preferred)
|
|
42
|
+
- **Session file path**: the session file in `.kontourai/flow-agents/<slug>/` (preferred)
|
|
43
43
|
- The session file references the plan artifact (which has acceptance criteria) and execution progress (which has modified files)
|
|
44
44
|
- If NO session file exists, delegate to tool-verifier directly (see Standalone Verification below)
|
|
45
45
|
|
|
@@ -84,6 +84,13 @@ Skip session file lookup — go straight to delegation.
|
|
|
84
84
|
7. Write or update `evidence.json` with verification checks, top-level verdict, and `not_verified_gaps`
|
|
85
85
|
- use `npm run workflow:sidecar -- record-evidence <artifact-dir> --verdict ... --check-json ...` when the repository provides it
|
|
86
86
|
- `checks[].artifact_refs` must use structured evidence ref objects, not legacy strings
|
|
87
|
+
- for multi-repo or cross-product work, preserve a coverage matrix in the
|
|
88
|
+
evidence report or check summaries that lists each affected root and its
|
|
89
|
+
build/test, dependency/security, provider/CI, and accepted-gap status
|
|
90
|
+
- if external dependency audit or provider checks are blocked by approval,
|
|
91
|
+
privacy, credentials, network, or missing change-provider state, record the
|
|
92
|
+
affected roots as `not_verified` instead of collapsing the lane into a
|
|
93
|
+
generic pass/fail
|
|
87
94
|
8. Update `acceptance.json` with criterion statuses and structured evidence refs
|
|
88
95
|
- `criteria[].evidence_refs` must use structured evidence refs and map each AC id to command/test proof plus source refs for behavior claims
|
|
89
96
|
- when source refs are missing for a behavior claim, mark the criterion `not_verified` or record an accepted gap instead of using broad prose-only evidence
|
package/kits/catalog.json
CHANGED
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
"name": "Release Evidence Kit",
|
|
19
19
|
"path": "kits/release-evidence",
|
|
20
20
|
"description": "Minimal flows-only kit for proving agentless gate evaluation over surface claims in CI. One gate expects a trusted release.evidence claim."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "veritas-governance",
|
|
24
|
+
"name": "Veritas Governance Kit",
|
|
25
|
+
"path": "kits/veritas-governance",
|
|
26
|
+
"description": "Agentless kit that gates a real `veritas readiness` verdict as a trust.bundle software-readiness-verdict claim. Wraps @kontourai/veritas via CLI + a kit-local adapter; does not reimplement standards evaluation."
|
|
21
27
|
}
|
|
22
28
|
]
|
|
23
29
|
}
|