vibe-coding-master 0.7.5 → 0.7.6
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 +19 -16
- package/dist/backend/adapters/git-adapter.js +15 -0
- package/dist/backend/api/artifact-routes.js +3 -0
- package/dist/backend/api/harness-routes.js +50 -27
- package/dist/backend/api/runtime-state-routes.js +7 -3
- package/dist/backend/api/task-routes.js +36 -4
- package/dist/backend/api/translation-routes.js +11 -2
- package/dist/backend/api/translation-worker-routes.js +37 -9
- package/dist/backend/cli/install-vcm-harness.js +40 -2
- package/dist/backend/gateway/gateway-service.js +34 -17
- package/dist/backend/server.js +12 -3
- package/dist/backend/services/artifact-service.js +4 -1
- package/dist/backend/services/auto-memory-service.js +156 -81
- package/dist/backend/services/claude-hook-service.js +50 -35
- package/dist/backend/services/command-dispatcher.js +1 -1
- package/dist/backend/services/gate-review-service.js +44 -0
- package/dist/backend/services/harness-feedback-service.js +19 -8
- package/dist/backend/services/harness-service.js +112 -34
- package/dist/backend/services/message-service.js +39 -2
- package/dist/backend/services/round-service.js +10 -121
- package/dist/backend/services/runtime-coordinator-service.js +18 -10
- package/dist/backend/services/runtime-recovery-service.js +1 -2
- package/dist/backend/services/session-service.js +36 -98
- package/dist/backend/services/status-service.js +1 -0
- package/dist/backend/services/task-close-service.js +12 -27
- package/dist/backend/services/task-workflow-service.js +228 -0
- package/dist/backend/services/translation-worker-service.js +14 -7
- package/dist/backend/templates/handoff.js +40 -1
- package/dist/backend/templates/harness/architect-agent.js +67 -19
- package/dist/backend/templates/harness/claude-root.js +25 -29
- package/dist/backend/templates/harness/gate-review.js +26 -13
- package/dist/backend/templates/harness/harness-engineer-agent.js +8 -8
- package/dist/backend/templates/harness/memory-block.js +69 -0
- package/dist/backend/templates/harness/project-known-issues.js +1 -0
- package/dist/backend/templates/harness/project-manager-agent.js +211 -73
- package/dist/backend/templates/harness/role-memory.js +9 -12
- package/dist/backend/templates/harness/tester-agent.js +4 -1
- package/dist/backend/templates/harness/vcm-architecture-interview-skill.js +82 -0
- package/dist/backend/templates/harness/vcm-final-acceptance-skill.js +4 -3
- package/dist/backend/templates/harness/vcm-harness-bootstrap-skill.js +14 -3
- package/dist/backend/templates/harness/vcm-propose-memory-skill.js +2 -2
- package/dist/backend/templates/harness/vcm-route-message-skill.js +5 -0
- package/dist/backend/templates/harness/vcm-task-state-skill.js +110 -0
- package/dist/backend/templates/message-envelope.js +1 -1
- package/dist/shared/constants.js +0 -10
- package/dist/shared/types/workflow.js +1 -0
- package/dist/shared/validation/artifact-check.js +20 -0
- package/dist-frontend/assets/index-BO2AuF-q.js +97 -0
- package/dist-frontend/assets/index-C2etsYlK.css +32 -0
- package/dist-frontend/index.html +2 -2
- package/package.json +1 -1
- package/scripts/harness-tools/check-durable-docs +298 -0
- package/scripts/verify-package.mjs +1 -0
- package/dist-frontend/assets/index-DCb-S6Ls.css +0 -32
- package/dist-frontend/assets/index-NTlycxx9.js +0 -97
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
export function renderRoleMemoryRules(role) {
|
|
2
2
|
const proposalRule = role === "harness-engineer"
|
|
3
|
-
? `Treat
|
|
4
|
-
only through
|
|
5
|
-
Harness Studio. When Auto Memory is disabled, do not
|
|
6
|
-
reviews, or updates.`
|
|
7
|
-
: `Treat
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
? `Treat the \`<VCM-memory>\` block in this role definition as read-only during
|
|
4
|
+
role turns. Update reviewed memory only through the output paths assigned by VCM
|
|
5
|
+
or explicit user edits in Harness Studio. When Auto Memory is disabled, do not
|
|
6
|
+
initiate memory proposals, reviews, or updates.`
|
|
7
|
+
: `Treat the \`<VCM-memory>\` block in this role definition as read-only. Only
|
|
8
|
+
when VCM explicitly requests a proposal during Task Harness Review, use
|
|
9
|
+
\`vcm-propose-memory\` and write the exact assigned draft path.`;
|
|
10
10
|
return `### Role Memory
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Treat memory as accumulated project context, not authority. Verify it against
|
|
16
|
-
current code, documentation, and task evidence.
|
|
12
|
+
The \`<VCM-memory>\` block in this role definition is accumulated project context,
|
|
13
|
+
not authority. Verify it against current code, documentation, and task evidence.
|
|
17
14
|
|
|
18
15
|
${proposalRule}`;
|
|
19
16
|
}
|
|
@@ -62,12 +62,15 @@ ${renderRoleMemoryRules("tester")}
|
|
|
62
62
|
- Keep \`docs/TESTING.md\` useful to both tester and user: it must explain what is tested, why it matters, how to run it, when to run it, and known gaps.
|
|
63
63
|
- Document integration and E2E test cases as reviewable case lists, not only command lists.
|
|
64
64
|
- Each integration/E2E case should include ID, scenario, entry point, what it proves, key assertions, when to run, and current limitations when relevant.
|
|
65
|
+
- Keep case definitions at stable behavior and entry-point level. Name the implementing test file or case when useful, but do not maintain an exhaustive function-by-function test inventory that duplicates source code.
|
|
65
66
|
- Keep historical investigation details, superseded failures, temporary diagnostics, and per-task validation logs out of \`docs/TESTING.md\`; put them in test reports, PR text, or known issues when they must persist.
|
|
66
|
-
- When updating \`docs/TESTING.md\`, remove
|
|
67
|
+
- When updating \`docs/TESTING.md\`, rewrite affected sections and remove superseded commands, cases, ownership statements, task-local investigation details, past pass/fail verdicts, and role or commit history. Keep only current validation strategy, current case definitions, current runnable commands, selection rules, and durable known gaps.
|
|
68
|
+
- Run \`.ai/tools/check-durable-docs\` after changing \`docs/TESTING.md\`. Record the command and result in \`test-report.md\`; a failing Tester-owned finding makes \`Test Result: fail\`.
|
|
67
69
|
|
|
68
70
|
### Outputs
|
|
69
71
|
|
|
70
72
|
- Write \`.ai/vcm/handoffs/test-report.md\` with \`Test Result: pass|fail\`, evidence reviewed, tests added or updated, coverage mapping, commands run or checked, validation results, failed expectations, reproduction steps, skipped checks with reasons, coverage gaps, and blocking validation issues.
|
|
73
|
+
- In Validation-Only Flow, if tests, fixtures, test-only helpers, or \`docs/TESTING.md\` changed, commit those changes before reporting and record the changed files and commit in \`test-report.md\`. If no tracked files changed, record that no commit was required.
|
|
71
74
|
- \`test-report.md\` is the current validation evidence, not a log; when rewriting it, carry forward still-unresolved findings or explicitly mark them resolved instead of dropping them.
|
|
72
75
|
- In \`Coverage Mapping\`, map each accepted changed behavior or relevant risk to its validation level, actual test file and case or external evidence, exercised entry path and key assertions, result, and any remaining gap.
|
|
73
76
|
- Use \`pass\` only when required validation completed and no blocking test failure, missing required coverage, unacceptable test weakness, or unresolved validation risk remains.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export function renderVcmArchitectureInterviewSkillRules() {
|
|
2
|
+
return `## Purpose
|
|
3
|
+
|
|
4
|
+
Use this skill only when project-manager routes the Architect Interview step of Code-Change Flow. Establish confirmed user-owned behavior before architecture planning begins.
|
|
5
|
+
|
|
6
|
+
During an active Architect Interview, handle the user's answers and final confirmation only as defined by this skill.
|
|
7
|
+
|
|
8
|
+
## Boundaries
|
|
9
|
+
|
|
10
|
+
- Do not write or revise \`.ai/vcm/handoffs/architecture-plan.md\`.
|
|
11
|
+
- Do not create code scaffold, \`VCM:CODE\` markers, production code, tests, or implementation commits.
|
|
12
|
+
- Do not ask the user to choose technical implementation, modules, files, dependencies, callable surfaces, task splitting, workload, validation commands, or test strategy.
|
|
13
|
+
- Do not create \`CONTEXT.md\`, ADRs, or durable documentation during the interview.
|
|
14
|
+
|
|
15
|
+
## Evidence First
|
|
16
|
+
|
|
17
|
+
- Read the PM route, task request, relevant durable docs, generated context, and enough current-worktree source to distinguish project facts from unresolved user decisions.
|
|
18
|
+
- If a fact can be established from the worktree or available tools, investigate it instead of asking the user.
|
|
19
|
+
- If code, docs, and the user's requested behavior conflict, state the concrete conflict and ask which user-visible behavior is intended.
|
|
20
|
+
|
|
21
|
+
## User Decision Filter
|
|
22
|
+
|
|
23
|
+
Ask only when two reasonable answers would materially change user-observable behavior, data meaning or business rules, lifecycle or failure behavior, compatibility or migration, permissions or security, irreversible effects, or an external contract.
|
|
24
|
+
|
|
25
|
+
Technical architecture decisions remain Architect-owned. Do not turn implementation uncertainty into a user question.
|
|
26
|
+
|
|
27
|
+
## Interview Protocol
|
|
28
|
+
|
|
29
|
+
- Ask one question per turn and wait for the user's answer.
|
|
30
|
+
- Explain why the decision affects the task and give the Architect's recommended answer with a concise rationale.
|
|
31
|
+
- Offer alternatives only when they represent a real user-owned trade-off.
|
|
32
|
+
- Treat exploratory, tentative, or hypothetical answers as discussion, not confirmation.
|
|
33
|
+
- After each resolved answer, update \`.ai/vcm/handoffs/architecture-brief.md\` immediately. Replace superseded content; do not append a transcript or decision history.
|
|
34
|
+
- During this formal interview, continue directly with the user across turns. Do not report each answer to project-manager.
|
|
35
|
+
- On every resumed interview turn, read the current brief before asking the next question.
|
|
36
|
+
- If planning returns to this interview with a newly discovered user-owned decision, set the brief status to \`interviewing\` and record that decision under Unresolved User Decisions before asking it.
|
|
37
|
+
|
|
38
|
+
## Artifact
|
|
39
|
+
|
|
40
|
+
Maintain exactly this structure:
|
|
41
|
+
|
|
42
|
+
\`\`\`md
|
|
43
|
+
# Architecture Brief: <task>
|
|
44
|
+
|
|
45
|
+
Architecture Brief Status: interviewing|confirmed
|
|
46
|
+
|
|
47
|
+
## Accepted Outcome
|
|
48
|
+
|
|
49
|
+
...
|
|
50
|
+
|
|
51
|
+
## Confirmed User Decisions
|
|
52
|
+
|
|
53
|
+
...
|
|
54
|
+
|
|
55
|
+
## Existing Constraints
|
|
56
|
+
|
|
57
|
+
...
|
|
58
|
+
|
|
59
|
+
## Unresolved User Decisions
|
|
60
|
+
|
|
61
|
+
...
|
|
62
|
+
|
|
63
|
+
## User Confirmation
|
|
64
|
+
|
|
65
|
+
...
|
|
66
|
+
\`\`\`
|
|
67
|
+
|
|
68
|
+
Record concise confirmed requirements and constraints, not implementation design. Use \`None\` under Unresolved User Decisions only when no user-owned decision remains.
|
|
69
|
+
|
|
70
|
+
## Completion
|
|
71
|
+
|
|
72
|
+
When no unresolved user decision remains, present the complete brief to the user and ask for explicit confirmation. If the user corrects it, update the brief and continue the interview.
|
|
73
|
+
|
|
74
|
+
Only after explicit confirmation:
|
|
75
|
+
|
|
76
|
+
1. Set \`Architecture Brief Status: confirmed\`.
|
|
77
|
+
2. Record the confirmation under User Confirmation.
|
|
78
|
+
3. Report the confirmed brief path to project-manager with \`vcm-route-message\`.
|
|
79
|
+
4. End the turn immediately.
|
|
80
|
+
|
|
81
|
+
Do not continue into architecture planning. Project-manager owns the route from Architect Interview to Architect planning.`;
|
|
82
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export function renderVcmFinalAcceptanceSkillRules() {
|
|
2
2
|
return `## Purpose
|
|
3
3
|
|
|
4
|
-
Use this skill only when project-manager is ready to close a complete VCM code-delivery flow, including
|
|
4
|
+
Use this skill only when project-manager is ready to close a complete VCM code-delivery flow, including Architect Debug Flow or an Architecture Diagnosis Flow that produced code changes.
|
|
5
5
|
|
|
6
|
-
Do not use it for
|
|
6
|
+
Do not use it for Docs-Only Flow, Validation-Only Flow, Communication-Only Flow, PR-Preparation Flow, analysis-only Diagnosis, Architect Debug Branch, or Architecture Diagnosis Branch.
|
|
7
7
|
|
|
8
8
|
This skill is a final evidence audit. It does not replace architect docs sync, tester validation acceptance, coder implementation responsibility, or user approval for high-risk decisions.
|
|
9
9
|
|
|
@@ -62,6 +62,7 @@ Check:
|
|
|
62
62
|
- required Gate Reviews are approved, or skipped/overridden through a VCM-recorded user action
|
|
63
63
|
- Gate Review enable state is confirmed authoritatively: do not infer that no Gate Reviews were required from an absent or empty \`.ai/vcm/gate-reviews/index.json\`. When Gate Review is enabled, a missing index or a required gate without a recorded decision means the gate was skipped — run the matching command from the \`vcm-gate-review\` skill, including the code source for \`code-diff\`, and do not accept until each required gate returns \`approve\`/\`already_approved\`, \`disabled\`/\`not_required\`, or a VCM-recorded user skip/override
|
|
64
64
|
- docs-sync report records docs updated, docs intentionally left unchanged, or required follow-up when docs sync was required
|
|
65
|
+
- when durable docs changed, docs-sync or tester evidence records a passing \`.ai/tools/check-durable-docs\` result and any cross-document inconsistency was resolved by the owning role
|
|
65
66
|
- known issues are either resolved, promoted to durable docs by architect, or explicitly accepted by the user
|
|
66
67
|
- temporary task state is ready to clean after durable facts are promoted
|
|
67
68
|
|
|
@@ -76,7 +77,7 @@ Choose exactly one:
|
|
|
76
77
|
- needs-docs-sync
|
|
77
78
|
- blocked-by-user-decision
|
|
78
79
|
|
|
79
|
-
Do not accept when required role evidence is missing, required Gate Review evidence is missing, tester findings are unresolved, docs sync is missing for durable changes, known-issues disposition is missing, or unexplained high-risk files remain.
|
|
80
|
+
Do not accept when required role evidence is missing, required Gate Review evidence is missing, tester findings are unresolved, docs sync is missing for durable changes, the durable-doc audit failed or is missing after durable-doc changes, known-issues disposition is missing, or unexplained high-risk files remain.
|
|
80
81
|
|
|
81
82
|
## Output
|
|
82
83
|
|
|
@@ -20,9 +20,10 @@ This skill is an operating procedure. It does not replace the deterministic VCM
|
|
|
20
20
|
3. Fill project context: add or update non-managed project facts in \`CLAUDE.md\` above the VCM managed block.
|
|
21
21
|
4. Fill durable docs: update \`docs/GLOSSARY.md\`, \`docs/CODING_STANDARDS.md\`, \`docs/ARCHITECTURE.md\`, module-level \`ARCHITECTURE.md\` files for clear non-root module boundaries, and \`docs/TESTING.md\` with detailed project-specific content.
|
|
22
22
|
5. Preserve user-authored content and VCM managed blocks.
|
|
23
|
-
6.
|
|
24
|
-
7.
|
|
25
|
-
8.
|
|
23
|
+
6. Run \`.ai/tools/check-durable-docs\` and correct every bootstrap-owned finding.
|
|
24
|
+
7. Review \`git status\` and \`git diff\`.
|
|
25
|
+
8. Stage only allowed bootstrap harness changes and create a commit in the active task worktree.
|
|
26
|
+
9. Report evidence, durable-doc audit result, commit hash, final git status, unknowns, confirmation-needed areas, generation failures, and recommended deterministic VCM actions.
|
|
26
27
|
|
|
27
28
|
## Typical Outputs
|
|
28
29
|
|
|
@@ -49,6 +50,7 @@ This skill is an operating procedure. It does not replace the deterministic VCM
|
|
|
49
50
|
- Run \`.ai/tools/generate-module-index\` when the generator exists and the project is supported.
|
|
50
51
|
- Run \`.ai/tools/generate-public-surface\` only after \`.ai/generated/module-index.json\` exists.
|
|
51
52
|
- If generation fails or the project is unsupported, report the reason. Do not invent generated artifacts.
|
|
53
|
+
- Treat generated context as the source of truth for module inventories, manifests, dependencies, source/test file inventories, and complete public-surface listings. Durable prose may explain those facts but must not maintain separate counts or exhaustive lists that can drift.
|
|
52
54
|
|
|
53
55
|
### \`docs/GLOSSARY.md\`
|
|
54
56
|
|
|
@@ -69,6 +71,7 @@ This skill is an operating procedure. It does not replace the deterministic VCM
|
|
|
69
71
|
- Document the project-level module overview, module responsibilities, module relationships, dependency direction, and project-wide constraints.
|
|
70
72
|
- Link to module-level \`ARCHITECTURE.md\` files when present.
|
|
71
73
|
- Explain generated-context ownership, especially that \`.ai/generated/public-surface.json\` is the machine index for public APIs, routes, and externally consumed surfaces.
|
|
74
|
+
- Describe current architecture only. Do not import task history, implementation chronology, validation results, commit history, or completed-work reports from existing project material.
|
|
72
75
|
|
|
73
76
|
### Module-Level \`ARCHITECTURE.md\`
|
|
74
77
|
|
|
@@ -76,14 +79,22 @@ This skill is an operating procedure. It does not replace the deterministic VCM
|
|
|
76
79
|
- Do not create a root-level \`ARCHITECTURE.md\` only because the root package exists.
|
|
77
80
|
- Document module boundaries, responsibilities, allowed dependencies, important behavior, important public surface explanations, risks, and update triggers.
|
|
78
81
|
- Keep complete public API listings in \`.ai/generated/public-surface.json\`; module docs should explain meaning and design intent, not duplicate the full generated index.
|
|
82
|
+
- Keep source-file inventories, exhaustive callables, and implementation walkthroughs out of module architecture docs.
|
|
79
83
|
|
|
80
84
|
### \`docs/TESTING.md\`
|
|
81
85
|
|
|
82
86
|
- Document validation levels, project-native validation commands, validation selection rules, final-validation cleanup, unit/integration test placement, generated-context freshness checks, and known testing gaps.
|
|
83
87
|
- Document integration and E2E test cases as reviewable case lists. Each case should include ID, scenario, entry point, what it proves, key assertions, when to run, and current limitations when relevant.
|
|
84
88
|
- Keep historical investigation details, superseded failures, temporary diagnostics, and per-task validation logs out of \`docs/TESTING.md\`.
|
|
89
|
+
- Keep current strategy, runnable commands, behavior-level integration/E2E cases, selection rules, cleanup requirements, and current gaps; do not create an exhaustive test-function inventory.
|
|
85
90
|
- Keep tester ownership of validation strategy and testing documentation clear.
|
|
86
91
|
|
|
92
|
+
### Active Plans And Known Issues
|
|
93
|
+
|
|
94
|
+
- Keep \`docs/plans/**\` limited to active or planned work. Remove completed or superseded plans from that collection; Git and PR history preserve them.
|
|
95
|
+
- Keep \`docs/known-issues.md\` limited to current unresolved durable issues and accepted limitations. Remove resolved entries and rewrite partially resolved entries around the remaining current gap.
|
|
96
|
+
- Do not preserve task chronology, role verdicts, validation history, or commit history in either collection.
|
|
97
|
+
|
|
87
98
|
### Commit
|
|
88
99
|
|
|
89
100
|
- Create the bootstrap commit yourself after the allowed files are updated.
|
|
@@ -4,8 +4,8 @@ Harness Review and provides an exact draft path.
|
|
|
4
4
|
|
|
5
5
|
## Rules
|
|
6
6
|
|
|
7
|
-
- Treat
|
|
8
|
-
never edits active memory.
|
|
7
|
+
- Treat every \`<VCM-memory>\` block as read-only. This skill creates a proposal;
|
|
8
|
+
it never edits active memory.
|
|
9
9
|
- Write only to the exact draft path assigned by VCM. The path must be under
|
|
10
10
|
\`.ai/vcm/memory-review/runs/<run-id>/drafts/\` in the active task worktree.
|
|
11
11
|
- If VCM did not provide a draft path, do not create a proposal.
|
|
@@ -53,6 +53,9 @@ For PM dispatch, use:
|
|
|
53
53
|
\`\`\`md
|
|
54
54
|
---
|
|
55
55
|
type: task
|
|
56
|
+
workflow_flow: code-change
|
|
57
|
+
workflow_step: coder-implementation
|
|
58
|
+
workflow_status: active
|
|
56
59
|
artifact_refs:
|
|
57
60
|
- .ai/vcm/handoffs/architecture-plan.md
|
|
58
61
|
- docs/plans/example.md
|
|
@@ -74,6 +77,8 @@ Stop conditions:
|
|
|
74
77
|
...
|
|
75
78
|
\`\`\`
|
|
76
79
|
|
|
80
|
+
PM route files should declare the workflow checkpoint fields defined by the \`vcm-task-state\` skill. Non-PM reports must not declare workflow state.
|
|
81
|
+
|
|
77
82
|
For non-PM reports, use:
|
|
78
83
|
|
|
79
84
|
\`\`\`md
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export function renderVcmTaskStateSkillRules() {
|
|
2
|
+
return `## Purpose
|
|
3
|
+
|
|
4
|
+
Use this skill only as project-manager to declare the current task workflow checkpoint to VCM.
|
|
5
|
+
|
|
6
|
+
The declaration is recoverable context, not a workflow controller. It does not authorize a transition, replace handoff artifacts, or decide the next role.
|
|
7
|
+
|
|
8
|
+
## Declaration
|
|
9
|
+
|
|
10
|
+
For a PM role dispatch, put the current declaration in the route-file frontmatter:
|
|
11
|
+
|
|
12
|
+
\`\`\`yaml
|
|
13
|
+
workflow_flow: code-change
|
|
14
|
+
workflow_step: coder-implementation
|
|
15
|
+
workflow_branch: none
|
|
16
|
+
workflow_resume_point: none
|
|
17
|
+
workflow_status: active
|
|
18
|
+
workflow_evidence_refs: .ai/vcm/handoffs/architecture-plan.md
|
|
19
|
+
\`\`\`
|
|
20
|
+
|
|
21
|
+
For a checkpoint without a role route, run:
|
|
22
|
+
|
|
23
|
+
\`\`\`bash
|
|
24
|
+
.ai/tools/update-task-state --flow code-change --step awaiting-user --status awaiting-user
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
Supply only fields that changed. Use \`none\` to clear branch or resume point. Repeat \`--evidence\` for evidence paths.
|
|
28
|
+
|
|
29
|
+
Declare the selected flow before its first dispatch, update the step on later PM dispatches, and update no-route checkpoints such as waiting for the user, waiting for Gate Review, or completion.
|
|
30
|
+
|
|
31
|
+
If declaration fails, report the warning when relevant and continue the existing workflow. Never delay routing, Gate Review, final acceptance, or task close because task state is unavailable.
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
export function renderUpdateTaskStateTool() {
|
|
35
|
+
return `#!/usr/bin/env python3
|
|
36
|
+
import argparse
|
|
37
|
+
import json
|
|
38
|
+
import os
|
|
39
|
+
import sys
|
|
40
|
+
import urllib.error
|
|
41
|
+
import urllib.parse
|
|
42
|
+
import urllib.request
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def emit(status, message=None, state=None):
|
|
46
|
+
payload = {"status": status}
|
|
47
|
+
if message:
|
|
48
|
+
payload["message"] = message
|
|
49
|
+
if state is not None:
|
|
50
|
+
payload["state"] = state
|
|
51
|
+
print(json.dumps(payload, ensure_ascii=False))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def main():
|
|
55
|
+
parser = argparse.ArgumentParser(description="Declare advisory VCM task workflow state.")
|
|
56
|
+
parser.add_argument("--flow")
|
|
57
|
+
parser.add_argument("--step")
|
|
58
|
+
parser.add_argument("--branch")
|
|
59
|
+
parser.add_argument("--resume-point")
|
|
60
|
+
parser.add_argument("--status")
|
|
61
|
+
parser.add_argument("--evidence", action="append", default=[])
|
|
62
|
+
args = parser.parse_args()
|
|
63
|
+
|
|
64
|
+
if os.environ.get("VCM_ROLE") != "project-manager":
|
|
65
|
+
emit("warning", "Only project-manager may declare VCM task workflow state.")
|
|
66
|
+
return 0
|
|
67
|
+
|
|
68
|
+
api_url = os.environ.get("VCM_API_URL", "").rstrip("/")
|
|
69
|
+
task_slug = os.environ.get("VCM_TASK_SLUG", "").strip()
|
|
70
|
+
if not api_url or not task_slug:
|
|
71
|
+
emit("warning", "VCM_API_URL or VCM_TASK_SLUG is unavailable; task state was not updated.")
|
|
72
|
+
return 0
|
|
73
|
+
|
|
74
|
+
payload = {}
|
|
75
|
+
for key, value in (
|
|
76
|
+
("flow", args.flow),
|
|
77
|
+
("step", args.step),
|
|
78
|
+
("branch", args.branch),
|
|
79
|
+
("resumePoint", args.resume_point),
|
|
80
|
+
("status", args.status),
|
|
81
|
+
):
|
|
82
|
+
if value is not None:
|
|
83
|
+
payload[key] = value
|
|
84
|
+
if args.evidence:
|
|
85
|
+
payload["evidenceRefs"] = args.evidence
|
|
86
|
+
|
|
87
|
+
if not payload:
|
|
88
|
+
emit("warning", "No task workflow fields were supplied.")
|
|
89
|
+
return 0
|
|
90
|
+
|
|
91
|
+
url = f"{api_url}/api/tasks/{urllib.parse.quote(task_slug, safe='')}/workflow-state"
|
|
92
|
+
request = urllib.request.Request(
|
|
93
|
+
url,
|
|
94
|
+
data=json.dumps(payload).encode("utf-8"),
|
|
95
|
+
headers={"content-type": "application/json"},
|
|
96
|
+
method="POST",
|
|
97
|
+
)
|
|
98
|
+
try:
|
|
99
|
+
with urllib.request.urlopen(request, timeout=3) as response:
|
|
100
|
+
state = json.loads(response.read().decode("utf-8"))
|
|
101
|
+
emit("updated", state=state)
|
|
102
|
+
except (OSError, ValueError, urllib.error.URLError, urllib.error.HTTPError) as error:
|
|
103
|
+
emit("warning", f"Task state was not updated: {error}")
|
|
104
|
+
return 0
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
if __name__ == "__main__":
|
|
108
|
+
sys.exit(main())
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
@@ -27,5 +27,5 @@ Instructions:
|
|
|
27
27
|
}
|
|
28
28
|
export function renderManualStagePrompt(message) {
|
|
29
29
|
const target = message.bodyPath ?? `VCM message ${message.id}`;
|
|
30
|
-
return `
|
|
30
|
+
return `[VCM MESSAGE]\nid: ${message.id}\nRead and handle the VCM message at ${target}.\n[/VCM MESSAGE]`;
|
|
31
31
|
}
|
package/dist/shared/constants.js
CHANGED
|
@@ -84,16 +84,6 @@ export function isHarnessEngineerToolRoleName(value) {
|
|
|
84
84
|
export function isDispatchableRole(value) {
|
|
85
85
|
return DISPATCHABLE_ROLES.includes(value);
|
|
86
86
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Roles that address the human operator. When a role in this set ends its turn
|
|
89
|
-
* with no onward route message, the flow is treated as awaiting a user decision
|
|
90
|
-
* (see the `awaiting-user` flow-pause reason). Single source of truth for that
|
|
91
|
-
* predicate.
|
|
92
|
-
*/
|
|
93
|
-
export const USER_FACING_ROLES = ["project-manager"];
|
|
94
|
-
export function isUserFacingRole(value) {
|
|
95
|
-
return USER_FACING_ROLES.includes(value);
|
|
96
|
-
}
|
|
97
87
|
export function getRoleDefinition(role) {
|
|
98
88
|
const definition = ROLE_DEFINITIONS.find((candidate) => candidate.name === role);
|
|
99
89
|
if (!definition) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
const REQUIRED_HEADINGS = {
|
|
2
|
+
"architecture-brief": [
|
|
3
|
+
"Accepted Outcome",
|
|
4
|
+
"Confirmed User Decisions",
|
|
5
|
+
"Existing Constraints",
|
|
6
|
+
"Unresolved User Decisions",
|
|
7
|
+
"User Confirmation"
|
|
8
|
+
],
|
|
2
9
|
"architecture-plan": [
|
|
3
10
|
"Accepted Scope",
|
|
4
11
|
"Current Code Reality",
|
|
@@ -103,6 +110,19 @@ export function checkMarkdownArtifact(kind, artifactPath, content) {
|
|
|
103
110
|
};
|
|
104
111
|
}
|
|
105
112
|
function validateArtifactFields(kind, content) {
|
|
113
|
+
if (kind === "architecture-brief") {
|
|
114
|
+
const status = /^\s*Architecture Brief Status\s*:\s*(\S+)\s*$/im.exec(content)?.[1]?.toLowerCase();
|
|
115
|
+
const invalidFields = status === "interviewing" || status === "confirmed"
|
|
116
|
+
? []
|
|
117
|
+
: ["Architecture Brief Status must be interviewing or confirmed."];
|
|
118
|
+
if (status === "confirmed") {
|
|
119
|
+
const unresolved = readArtifactSectionValue(content, "Unresolved User Decisions");
|
|
120
|
+
if (!unresolved || !/^none\.?$/i.test(unresolved)) {
|
|
121
|
+
invalidFields.push("Unresolved User Decisions must be None when Architecture Brief Status is confirmed.");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return invalidFields;
|
|
125
|
+
}
|
|
106
126
|
if (kind === "test-report") {
|
|
107
127
|
const result = /^\s*Test Result\s*:\s*(\S+)\s*$/im.exec(content)?.[1]?.toLowerCase();
|
|
108
128
|
const invalidFields = result === "pass" || result === "fail"
|