vibe-coding-master 0.7.4 → 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.
Files changed (57) hide show
  1. package/README.md +19 -16
  2. package/dist/backend/adapters/git-adapter.js +15 -0
  3. package/dist/backend/api/artifact-routes.js +3 -0
  4. package/dist/backend/api/harness-routes.js +50 -27
  5. package/dist/backend/api/runtime-state-routes.js +7 -3
  6. package/dist/backend/api/task-routes.js +36 -4
  7. package/dist/backend/api/translation-routes.js +11 -2
  8. package/dist/backend/api/translation-worker-routes.js +37 -9
  9. package/dist/backend/cli/install-vcm-harness.js +40 -2
  10. package/dist/backend/gateway/gateway-service.js +34 -17
  11. package/dist/backend/server.js +12 -3
  12. package/dist/backend/services/artifact-service.js +5 -1
  13. package/dist/backend/services/auto-memory-service.js +156 -81
  14. package/dist/backend/services/claude-hook-service.js +50 -35
  15. package/dist/backend/services/command-dispatcher.js +1 -1
  16. package/dist/backend/services/gate-review-service.js +335 -31
  17. package/dist/backend/services/harness-feedback-service.js +19 -8
  18. package/dist/backend/services/harness-service.js +112 -34
  19. package/dist/backend/services/message-service.js +39 -2
  20. package/dist/backend/services/round-service.js +10 -121
  21. package/dist/backend/services/runtime-coordinator-service.js +18 -10
  22. package/dist/backend/services/runtime-recovery-service.js +1 -2
  23. package/dist/backend/services/session-service.js +36 -98
  24. package/dist/backend/services/status-service.js +1 -0
  25. package/dist/backend/services/task-close-service.js +12 -27
  26. package/dist/backend/services/task-workflow-service.js +228 -0
  27. package/dist/backend/services/translation-worker-service.js +14 -7
  28. package/dist/backend/templates/handoff.js +128 -1
  29. package/dist/backend/templates/harness/architect-agent.js +85 -22
  30. package/dist/backend/templates/harness/claude-root.js +25 -29
  31. package/dist/backend/templates/harness/coder-agent.js +5 -7
  32. package/dist/backend/templates/harness/coder-worker-agent.js +3 -3
  33. package/dist/backend/templates/harness/gate-review.js +292 -65
  34. package/dist/backend/templates/harness/harness-engineer-agent.js +8 -8
  35. package/dist/backend/templates/harness/memory-block.js +69 -0
  36. package/dist/backend/templates/harness/project-known-issues.js +1 -0
  37. package/dist/backend/templates/harness/project-manager-agent.js +217 -75
  38. package/dist/backend/templates/harness/role-memory.js +9 -12
  39. package/dist/backend/templates/harness/tester-agent.js +8 -4
  40. package/dist/backend/templates/harness/vcm-architecture-interview-skill.js +82 -0
  41. package/dist/backend/templates/harness/vcm-final-acceptance-skill.js +4 -3
  42. package/dist/backend/templates/harness/vcm-harness-bootstrap-skill.js +14 -3
  43. package/dist/backend/templates/harness/vcm-propose-memory-skill.js +2 -2
  44. package/dist/backend/templates/harness/vcm-route-message-skill.js +5 -0
  45. package/dist/backend/templates/harness/vcm-task-state-skill.js +110 -0
  46. package/dist/backend/templates/message-envelope.js +1 -1
  47. package/dist/shared/constants.js +0 -10
  48. package/dist/shared/types/workflow.js +1 -0
  49. package/dist/shared/validation/artifact-check.js +41 -1
  50. package/dist-frontend/assets/index-BO2AuF-q.js +97 -0
  51. package/dist-frontend/assets/index-C2etsYlK.css +32 -0
  52. package/dist-frontend/index.html +2 -2
  53. package/package.json +1 -1
  54. package/scripts/harness-tools/check-durable-docs +298 -0
  55. package/scripts/verify-package.mjs +1 -0
  56. package/dist-frontend/assets/index-DCb-S6Ls.css +0 -32
  57. package/dist-frontend/assets/index-NTlycxx9.js +0 -97
@@ -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. Review \`git status\` and \`git diff\`.
24
- 7. Stage only allowed bootstrap harness changes and create a commit in the active task worktree.
25
- 8. Report evidence, commit hash, final git status, unknowns, confirmation-needed areas, generation failures, and recommended deterministic VCM actions.
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 \`.ai/vcm/memory/**\` as read-only. This skill creates a proposal; it
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 `Read and handle VCM message ${message.id} at ${target}`;
30
+ return `[VCM MESSAGE]\nid: ${message.id}\nRead and handle the VCM message at ${target}.\n[/VCM MESSAGE]`;
31
31
  }
@@ -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,8 +1,27 @@
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",
12
+ "Planning Boundary",
13
+ "Code Reading Evidence",
14
+ "Existing Behavior Trace",
15
+ "Code / Docs Conflicts",
5
16
  "Architecture Decision",
17
+ "Changed Behavior Flow",
18
+ "Ownership",
19
+ "Data Flow",
20
+ "Lifecycle",
21
+ "Boundaries",
22
+ "Invariants",
23
+ "Failure Model",
24
+ "Decision Rationale",
6
25
  "Module/File Plan",
7
26
  "Public Surface Impact",
8
27
  "Scaffold Manifest",
@@ -18,6 +37,7 @@ const REQUIRED_HEADINGS = {
18
37
  "test-report": [
19
38
  "Evidence Reviewed",
20
39
  "Tests Added Or Updated",
40
+ "Coverage Mapping",
21
41
  "Commands Run Or Checked",
22
42
  "Validation Results",
23
43
  "Failed Expectations",
@@ -90,11 +110,31 @@ export function checkMarkdownArtifact(kind, artifactPath, content) {
90
110
  };
91
111
  }
92
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
+ }
93
126
  if (kind === "test-report") {
94
127
  const result = /^\s*Test Result\s*:\s*(\S+)\s*$/im.exec(content)?.[1]?.toLowerCase();
95
- return result === "pass" || result === "fail"
128
+ const invalidFields = result === "pass" || result === "fail"
96
129
  ? []
97
130
  : ["Test Result must be pass or fail."];
131
+ if (result === "pass") {
132
+ const blockingIssues = readArtifactSectionValue(content, "Blocking Validation Issues");
133
+ if (!blockingIssues || !/^none\.?$/i.test(blockingIssues)) {
134
+ invalidFields.push("Blocking Validation Issues must be None when Test Result is pass.");
135
+ }
136
+ }
137
+ return invalidFields;
98
138
  }
99
139
  if (kind === "docs-sync-report") {
100
140
  return validateDecision(content, ["synced", "unchanged", "blocked"]);