@aperant/framework 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +226 -29
  2. package/agents/apt-planner.md +15 -0
  3. package/agents/apt-verifier.md +15 -10
  4. package/bin/apt-proof-video.mjs +256 -76
  5. package/dist/cli/commands/apply-recipe.d.mts +6 -0
  6. package/dist/cli/commands/apply-recipe.d.mts.map +1 -0
  7. package/dist/cli/commands/apply-recipe.mjs +98 -0
  8. package/dist/cli/commands/apply-recipe.mjs.map +1 -0
  9. package/dist/cli/commands/mobile-prepare.d.mts +53 -0
  10. package/dist/cli/commands/mobile-prepare.d.mts.map +1 -0
  11. package/dist/cli/commands/mobile-prepare.mjs +139 -0
  12. package/dist/cli/commands/mobile-prepare.mjs.map +1 -0
  13. package/dist/cli/commands/recipe-diff.d.mts +6 -0
  14. package/dist/cli/commands/recipe-diff.d.mts.map +1 -0
  15. package/dist/cli/commands/recipe-diff.mjs +75 -0
  16. package/dist/cli/commands/recipe-diff.mjs.map +1 -0
  17. package/dist/cli/commands/roadmap.d.mts.map +1 -1
  18. package/dist/cli/commands/roadmap.mjs +53 -0
  19. package/dist/cli/commands/roadmap.mjs.map +1 -1
  20. package/dist/cli/commands/validate-evidence.d.mts +1 -1
  21. package/dist/cli/commands/verify-sandbox.d.mts +6 -0
  22. package/dist/cli/commands/verify-sandbox.d.mts.map +1 -0
  23. package/dist/cli/commands/verify-sandbox.mjs +200 -0
  24. package/dist/cli/commands/verify-sandbox.mjs.map +1 -0
  25. package/dist/cli/consistency/parse-qa.d.mts.map +1 -1
  26. package/dist/cli/consistency/parse-qa.mjs +18 -4
  27. package/dist/cli/consistency/parse-qa.mjs.map +1 -1
  28. package/dist/cli/consistency/rules/r5-verdict-consistency.d.mts.map +1 -1
  29. package/dist/cli/consistency/rules/r5-verdict-consistency.mjs +11 -10
  30. package/dist/cli/consistency/rules/r5-verdict-consistency.mjs.map +1 -1
  31. package/dist/cli/coverage-check/user-outcomes.d.mts +7 -2
  32. package/dist/cli/coverage-check/user-outcomes.d.mts.map +1 -1
  33. package/dist/cli/coverage-check/user-outcomes.mjs +50 -17
  34. package/dist/cli/coverage-check/user-outcomes.mjs.map +1 -1
  35. package/dist/cli/design/frontmatter-schema.d.mts +8 -8
  36. package/dist/cli/dispatch.d.mts.map +1 -1
  37. package/dist/cli/dispatch.mjs +28 -0
  38. package/dist/cli/dispatch.mjs.map +1 -1
  39. package/dist/cli/gate/gates/verify-approved.d.mts +0 -48
  40. package/dist/cli/gate/gates/verify-approved.d.mts.map +1 -1
  41. package/dist/cli/gate/gates/verify-approved.mjs +23 -80
  42. package/dist/cli/gate/gates/verify-approved.mjs.map +1 -1
  43. package/dist/cli/install/mcp-server-specs.d.mts +6 -5
  44. package/dist/cli/install/mcp-server-specs.d.mts.map +1 -1
  45. package/dist/cli/install/mcp-server-specs.mjs +22 -4
  46. package/dist/cli/install/mcp-server-specs.mjs.map +1 -1
  47. package/dist/cli/personas/sidecar.d.mts +1 -1
  48. package/dist/cli/roadmap/backend-adapter.d.mts +43 -0
  49. package/dist/cli/roadmap/backend-adapter.d.mts.map +1 -0
  50. package/dist/cli/roadmap/backend-adapter.mjs +222 -0
  51. package/dist/cli/roadmap/backend-adapter.mjs.map +1 -0
  52. package/dist/cli/roadmap/lifecycle.d.mts +1 -1
  53. package/dist/cli/roadmap/rollup.d.mts +2 -2
  54. package/dist/cli/util/runtime-capabilities.d.mts +7 -0
  55. package/dist/cli/util/runtime-capabilities.d.mts.map +1 -1
  56. package/dist/cli/util/runtime-capabilities.mjs +65 -0
  57. package/dist/cli/util/runtime-capabilities.mjs.map +1 -1
  58. package/dist/cli/verify-proof/manifest-validator.mjs +13 -0
  59. package/dist/cli/verify-proof/manifest-validator.mjs.map +1 -1
  60. package/dist/cli/verify-proof/resolver.d.mts +10 -7
  61. package/dist/cli/verify-proof/resolver.d.mts.map +1 -1
  62. package/dist/cli/verify-proof/resolver.mjs +28 -7
  63. package/dist/cli/verify-proof/resolver.mjs.map +1 -1
  64. package/dist/cli/verify-proof/sandbox/apply.d.mts +64 -0
  65. package/dist/cli/verify-proof/sandbox/apply.d.mts.map +1 -0
  66. package/dist/cli/verify-proof/sandbox/apply.mjs +379 -0
  67. package/dist/cli/verify-proof/sandbox/apply.mjs.map +1 -0
  68. package/dist/cli/verify-proof/sandbox/gate-predicate.d.mts +63 -0
  69. package/dist/cli/verify-proof/sandbox/gate-predicate.d.mts.map +1 -0
  70. package/dist/cli/verify-proof/sandbox/gate-predicate.mjs +115 -0
  71. package/dist/cli/verify-proof/sandbox/gate-predicate.mjs.map +1 -0
  72. package/dist/cli/verify-proof/sandbox/pattern-matcher.d.mts +57 -0
  73. package/dist/cli/verify-proof/sandbox/pattern-matcher.d.mts.map +1 -0
  74. package/dist/cli/verify-proof/sandbox/pattern-matcher.mjs +124 -0
  75. package/dist/cli/verify-proof/sandbox/pattern-matcher.mjs.map +1 -0
  76. package/dist/cli/verify-proof/sandbox/recipe-diff.d.mts +28 -0
  77. package/dist/cli/verify-proof/sandbox/recipe-diff.d.mts.map +1 -0
  78. package/dist/cli/verify-proof/sandbox/recipe-diff.mjs +190 -0
  79. package/dist/cli/verify-proof/sandbox/recipe-diff.mjs.map +1 -0
  80. package/dist/cli/verify-proof/sandbox/sandbox-config.d.mts +25 -0
  81. package/dist/cli/verify-proof/sandbox/sandbox-config.d.mts.map +1 -0
  82. package/dist/cli/verify-proof/sandbox/sandbox-config.mjs +85 -0
  83. package/dist/cli/verify-proof/sandbox/sandbox-config.mjs.map +1 -0
  84. package/dist/cli/verify-proof/sandbox/self-test.d.mts +39 -0
  85. package/dist/cli/verify-proof/sandbox/self-test.d.mts.map +1 -0
  86. package/dist/cli/verify-proof/sandbox/self-test.mjs +248 -0
  87. package/dist/cli/verify-proof/sandbox/self-test.mjs.map +1 -0
  88. package/dist/plugin/.claude-plugin/plugin.json +1 -1
  89. package/dist/plugin/agents/apt-planner.md +15 -0
  90. package/dist/plugin/agents/apt-verifier.md +15 -10
  91. package/dist/plugin/skills/apt/SKILL.md +2 -2
  92. package/dist/plugin/skills/apt-plan/SKILL.md +23 -0
  93. package/dist/plugin/skills/apt-run/SKILL.md +1 -1
  94. package/dist/plugin/skills/apt-setup/SKILL.md +56 -0
  95. package/dist/plugin/skills/apt-verify/SKILL.md +20 -15
  96. package/dist/plugin/skills/apt-verify-proof/SKILL.md +146 -11
  97. package/dist/proof-report.d.ts.map +1 -1
  98. package/dist/proof-report.js +4 -1
  99. package/dist/proof-report.js.map +1 -1
  100. package/dist/types/config.d.ts +42 -4
  101. package/dist/types/config.d.ts.map +1 -1
  102. package/dist/types/qa-scoring.d.ts +45 -9
  103. package/dist/types/qa-scoring.d.ts.map +1 -1
  104. package/dist/types/qa-scoring.js +34 -13
  105. package/dist/types/qa-scoring.js.map +1 -1
  106. package/dist/types/state.d.ts +7 -2
  107. package/dist/types/state.d.ts.map +1 -1
  108. package/dist/types/task-record.d.ts +10 -2
  109. package/dist/types/task-record.d.ts.map +1 -1
  110. package/drivers/mobile/README.md +40 -0
  111. package/drivers/mobile/driver.mjs +106 -0
  112. package/drivers/mobile/manifest.json +49 -0
  113. package/package.json +138 -138
  114. package/prompts/inbox-clarification.md +17 -0
  115. package/prompts/inbox-triage.md +21 -0
  116. package/prompts/qa_orchestrator_agentic.md +18 -17
  117. package/prompts/qa_reviewer.md +17 -15
  118. package/skills/apt/SKILL.md +2 -2
  119. package/skills/apt-plan/SKILL.md +23 -0
  120. package/skills/apt-run/SKILL.md +1 -1
  121. package/skills/apt-setup/SKILL.md +56 -0
  122. package/skills/apt-verifier.md +7 -4
  123. package/skills/apt-verify/SKILL.md +20 -15
  124. package/skills/apt-verify-proof/SKILL.md +146 -11
  125. package/src/cli/commands/apply-recipe.mjs +105 -0
  126. package/src/cli/commands/mobile-prepare.mjs +151 -0
  127. package/src/cli/commands/recipe-diff.mjs +81 -0
  128. package/src/cli/commands/roadmap.mjs +54 -0
  129. package/src/cli/commands/verify-sandbox.mjs +231 -0
  130. package/src/cli/consistency/parse-qa.mjs +20 -4
  131. package/src/cli/consistency/rules/r5-verdict-consistency.mjs +11 -13
  132. package/src/cli/coverage-check/user-outcomes.mjs +52 -17
  133. package/src/cli/dispatch.mjs +27 -0
  134. package/src/cli/gate/gates/verify-approved.mjs +22 -81
  135. package/src/cli/install/mcp-server-specs.mjs +24 -4
  136. package/src/cli/roadmap/backend-adapter.mjs +231 -0
  137. package/src/cli/util/runtime-capabilities.mjs +67 -0
  138. package/src/cli/verify-proof/manifest-validator.mjs +15 -0
  139. package/src/cli/verify-proof/resolver.mjs +27 -7
  140. package/src/cli/verify-proof/sandbox/apply.mjs +401 -0
  141. package/src/cli/verify-proof/sandbox/gate-predicate.mjs +126 -0
  142. package/src/cli/verify-proof/sandbox/pattern-matcher.mjs +127 -0
  143. package/src/cli/verify-proof/sandbox/recipe-diff.mjs +208 -0
  144. package/src/cli/verify-proof/sandbox/sandbox-config.mjs +82 -0
  145. package/src/cli/verify-proof/sandbox/sandbox-schema.json +33 -0
  146. package/src/cli/verify-proof/sandbox/self-test.mjs +265 -0
  147. package/templates/config.json +10 -1
  148. package/templates/proof-verification.md +27 -8
  149. package/workflows/verify-proof.md +376 -302
@@ -0,0 +1,106 @@
1
+ /**
2
+ * mobile/driver.mjs — bundled unified mobile driver (iOS + Android).
3
+ *
4
+ * Wraps the `mobile-mcp` MCP server (mobile-next/mobile-mcp, Apache-2.0),
5
+ * the single UI-driving backend for BOTH platforms (decision D-01). The
6
+ * platform/device is chosen INSIDE the tool call (mobile_list_available_
7
+ * devices → device id), NOT at resolver time — that is why one driver
8
+ * targets ios/android/expo/react-native.
9
+ *
10
+ * The app lifecycle (build / install / launch / Metro / ready-gate) is
11
+ * owned by `apt-tools mobile prepare`, NOT this driver (D-03/D-04). This
12
+ * driver assumes a foregrounded, JS-ready app and only drives UI + captures
13
+ * evidence.
14
+ *
15
+ * Per ID-01 — the workflow prose NEVER names mcp__mobile-mcp__* tools; the
16
+ * verb→tool mapping lives ONLY here. Transport dispatch happens at the
17
+ * workflow-runner layer (which holds the model's tool surface).
18
+ *
19
+ * IDL verb → mobile-mcp tool mapping:
20
+ * launch → mobile_use_device (select the booted device/simulator)
21
+ * click → mobile_click_on_screen_at_coordinates
22
+ * type → mobile_type_keys
23
+ * key → mobile_press_button
24
+ * swipe → mobile_swipe_on_screen
25
+ * screenshot → mobile_save_screenshot
26
+ * capture_logs → mobile_device_logs
27
+ * assert_visible → mobile_list_elements_on_screen (element present)
28
+ * assert_text → mobile_list_elements_on_screen (text match)
29
+ * teardown → mobile_terminate_app (best-effort)
30
+ *
31
+ * The driver is a thin adapter: it validates input shape via the IDL
32
+ * arg-metadata and returns a VerbResult. The actual transport dispatch
33
+ * happens at the workflow runner layer. For conformance testing we expose
34
+ * the verb signatures as identity stubs returning VerbResult — the SDK
35
+ * conformance kit then validates the shape contract.
36
+ */
37
+
38
+ import { validateVerbArgs } from '../../src/cli/verify-proof/idl/index.mjs'
39
+
40
+ /** Build a success VerbResult. */
41
+ function ok(evidence_paths = []) {
42
+ return { status: 'success', evidence_paths, duration_ms: 0, retry_count: 0 }
43
+ }
44
+ function fail(error) {
45
+ return { status: 'fail', evidence_paths: [], duration_ms: 0, retry_count: 0, error }
46
+ }
47
+
48
+ /**
49
+ * Validate args + return a VerbResult shape stub. Real transport invocation
50
+ * happens at the workflow-runner layer (model holds the tool surface —
51
+ * mcp__mobile-mcp__*).
52
+ *
53
+ * @param {string} verb
54
+ * @param {Record<string, unknown>} args
55
+ * @returns {{status: 'success'|'fail'|'skip', evidence_paths: string[], duration_ms: number, retry_count: number, error?: string}}
56
+ */
57
+ function adaptVerb(verb, args) {
58
+ const check = validateVerbArgs(verb, args)
59
+ if (!check.valid) {
60
+ return fail(`mobile.${verb}: missing required args: ${check.missing.join(', ')}`)
61
+ }
62
+ if (verb === 'screenshot' && typeof args.output_path === 'string') {
63
+ return ok([args.output_path])
64
+ }
65
+ return ok([])
66
+ }
67
+
68
+ export async function launch(args) {
69
+ return adaptVerb('launch', args)
70
+ }
71
+
72
+ export async function click(args) {
73
+ return adaptVerb('click', args)
74
+ }
75
+
76
+ export async function type(args) {
77
+ return adaptVerb('type', args)
78
+ }
79
+
80
+ export async function key(args) {
81
+ return adaptVerb('key', args)
82
+ }
83
+
84
+ export async function swipe(args) {
85
+ return adaptVerb('swipe', args)
86
+ }
87
+
88
+ export async function screenshot(args) {
89
+ return adaptVerb('screenshot', args)
90
+ }
91
+
92
+ export async function capture_logs(args) {
93
+ return adaptVerb('capture_logs', args)
94
+ }
95
+
96
+ export async function assert_visible(args) {
97
+ return adaptVerb('assert_visible', args)
98
+ }
99
+
100
+ export async function assert_text(args) {
101
+ return adaptVerb('assert_text', args)
102
+ }
103
+
104
+ export async function teardown(args) {
105
+ return adaptVerb('teardown', args)
106
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "driverId": "mobile",
3
+ "version": "0.1.0",
4
+ "targets": ["ios", "android", "expo", "react-native"],
5
+ "capabilities": [
6
+ "launch",
7
+ "click",
8
+ "type",
9
+ "key",
10
+ "swipe",
11
+ "screenshot",
12
+ "capture_logs",
13
+ "assert_visible",
14
+ "assert_text",
15
+ "teardown"
16
+ ],
17
+ "evidence_capabilities": ["screenshot", "capture_logs"],
18
+ "frameworkApiRange": "^1.0.0",
19
+ "priority": 80,
20
+ "stability": "ga",
21
+ "trust": {
22
+ "tier": "first_party_signed",
23
+ "publisher": {
24
+ "name": "Aperant",
25
+ "npm_scope": "@aperant",
26
+ "github_org": "Mikalsen-AI",
27
+ "verified": true
28
+ }
29
+ },
30
+ "security": {
31
+ "sandbox_profile": "workspace_write",
32
+ "network": "deny",
33
+ "requires_user_approval": false
34
+ },
35
+ "audit": { "log_invocations": true, "log_manifest_hash": true },
36
+ "preflight": [
37
+ {
38
+ "name": "xcrun (iOS Simulator toolchain)",
39
+ "command": { "binary": "xcrun", "args": ["simctl", "help"] },
40
+ "required": false
41
+ },
42
+ {
43
+ "name": "adb (Android platform-tools)",
44
+ "command": { "binary": "adb", "args": ["--version"] },
45
+ "required": false
46
+ }
47
+ ],
48
+ "transport": { "mcp_server_id": "mobile-mcp" }
49
+ }
package/package.json CHANGED
@@ -1,139 +1,139 @@
1
1
  {
2
- "name": "@aperant/framework",
3
- "version": "0.11.0",
4
- "description": "AI coding framework — composable skills for planning, executing, verifying, and reviewing code with any LLM provider. Works as Claude Code commands, Codex tasks, or programmatically.",
5
- "author": "Mikalsen AI <hello@mikalsen.ai>",
6
- "type": "module",
7
- "main": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "bin": {
10
- "framework": "./bin/apt-tools.mjs",
11
- "apt-tools": "./bin/apt-tools.mjs",
12
- "apt-proof-video": "./bin/apt-proof-video.mjs"
13
- },
14
- "exports": {
15
- ".": {
16
- "types": "./dist/index.d.ts",
17
- "import": "./dist/index.js"
18
- },
19
- "./types": {
20
- "types": "./dist/types/index.d.ts",
21
- "import": "./dist/types/index.js"
22
- },
23
- "./cost": {
24
- "types": "./dist/cost/index.d.ts",
25
- "import": "./dist/cost/index.js"
26
- },
27
- "./mappers": {
28
- "types": "./dist/mappers/index.d.ts",
29
- "import": "./dist/mappers/index.js"
30
- },
31
- "./schemas": {
32
- "types": "./dist/schemas/index.d.ts",
33
- "import": "./dist/schemas/index.js"
34
- },
35
- "./standalone": {
36
- "types": "./dist/standalone/index.d.ts",
37
- "import": "./dist/standalone/index.js"
38
- },
39
- "./driver-sdk": {
40
- "types": "./dist/driver-sdk/index.d.ts",
41
- "import": "./dist/driver-sdk/index.js"
42
- },
43
- "./coordination/event-schema": {
44
- "types": "./src/cli/coordination/event-schema.d.ts",
45
- "import": "./src/cli/coordination/event-schema.mjs"
46
- },
47
- "./roadmap/conductor-view": {
48
- "types": "./src/cli/roadmap/conductor-view.d.ts",
49
- "import": "./src/cli/roadmap/conductor-view.mjs"
50
- },
51
- "./design/scan": {
52
- "import": "./src/cli/design/scan.mjs"
53
- },
54
- "./design/extract-repo": {
55
- "import": "./src/cli/design/extract-repo.mjs"
56
- },
57
- "./design/synthesize": {
58
- "import": "./src/cli/design/synthesize.mjs"
59
- }
60
- },
61
- "scripts": {
62
- "build": "tsc && node scripts/extract-personas-schema.mjs",
63
- "dev": "tsc --watch --preserveWatchOutput",
64
- "typecheck": "tsc --noEmit",
65
- "lint": "biome check . --diagnostic-level=error",
66
- "lint:fix": "biome check --write . --diagnostic-level=error",
67
- "clean": "rm -rf dist",
68
- "test": "vitest run",
69
- "c28:cutover": "node scripts/c28-cutover.mjs",
70
- "build-plugin": "node scripts/build-plugin.mjs",
71
- "publish-plugin": "node scripts/publish-plugin.mjs",
72
- "publish:verdaccio": "node scripts/publish-verdaccio.mjs",
73
- "release:verdaccio": "pnpm build && pnpm publish:verdaccio",
74
- "ship:verdaccio": "npm version patch --no-git-tag-version && pnpm build && pnpm publish:verdaccio"
75
- },
76
- "files": [
77
- "dist/",
78
- "bin/",
79
- "src/cli/",
80
- "src/cost/",
81
- "commands/",
82
- "skills/",
83
- "agents/",
84
- "prompts/",
85
- "templates/",
86
- "context/",
87
- "workflows/",
88
- "drivers/",
89
- "examples/",
90
- "LICENSE",
91
- "README.md",
92
- "CHANGELOG.md",
93
- "!**/__tests__/**",
94
- "!**/*.test.*",
95
- "!**/*.spec.*",
96
- "!**/*.test.d.ts.map",
97
- "!**/*.test.js.map"
98
- ],
99
- "keywords": [
100
- "ai",
101
- "framework",
102
- "coding-assistant",
103
- "claude-code",
104
- "codex",
105
- "aperant"
106
- ],
107
- "license": "AGPL-3.0-only",
108
- "homepage": "https://github.com/Mikalsen-AI/aperant-cloud-desktop/tree/main/packages/framework#readme",
109
- "bugs": {
110
- "url": "https://github.com/Mikalsen-AI/aperant-cloud-desktop/issues"
111
- },
112
- "repository": {
113
- "type": "git",
114
- "url": "https://github.com/Mikalsen-AI/aperant-cloud-desktop.git",
115
- "directory": "packages/framework"
116
- },
117
- "engines": {
118
- "node": ">=18.0.0"
119
- },
120
- "publishConfig": {
121
- "access": "public"
122
- },
123
- "dependencies": {
124
- "@clack/prompts": "^1.2.0",
125
- "proper-lockfile": "^4.1.2",
126
- "yaml": "^2.8.3",
127
- "zod": "^4.3.6"
128
- },
129
- "optionalDependencies": {
130
- "@babel/parser": "^7.29.2",
131
- "@babel/traverse": "^7.29.0",
132
- "@google/genai": "^1.50.1",
133
- "css-tree": "^3.2.1",
134
- "playwright": "^1.59.1"
135
- },
136
- "devDependencies": {
137
- "@vitest/coverage-v8": "^4.1.5"
138
- }
139
- }
2
+ "name": "@aperant/framework",
3
+ "version": "0.12.1",
4
+ "description": "AI coding framework — composable skills for planning, executing, verifying, and reviewing code with any LLM provider. Works as Claude Code commands, Codex tasks, or programmatically.",
5
+ "author": "Mikalsen AI <hello@mikalsen.ai>",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "bin": {
10
+ "framework": "./bin/apt-tools.mjs",
11
+ "apt-tools": "./bin/apt-tools.mjs",
12
+ "apt-proof-video": "./bin/apt-proof-video.mjs"
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./types": {
20
+ "types": "./dist/types/index.d.ts",
21
+ "import": "./dist/types/index.js"
22
+ },
23
+ "./cost": {
24
+ "types": "./dist/cost/index.d.ts",
25
+ "import": "./dist/cost/index.js"
26
+ },
27
+ "./mappers": {
28
+ "types": "./dist/mappers/index.d.ts",
29
+ "import": "./dist/mappers/index.js"
30
+ },
31
+ "./schemas": {
32
+ "types": "./dist/schemas/index.d.ts",
33
+ "import": "./dist/schemas/index.js"
34
+ },
35
+ "./standalone": {
36
+ "types": "./dist/standalone/index.d.ts",
37
+ "import": "./dist/standalone/index.js"
38
+ },
39
+ "./driver-sdk": {
40
+ "types": "./dist/driver-sdk/index.d.ts",
41
+ "import": "./dist/driver-sdk/index.js"
42
+ },
43
+ "./coordination/event-schema": {
44
+ "types": "./src/cli/coordination/event-schema.d.ts",
45
+ "import": "./src/cli/coordination/event-schema.mjs"
46
+ },
47
+ "./roadmap/conductor-view": {
48
+ "types": "./src/cli/roadmap/conductor-view.d.ts",
49
+ "import": "./src/cli/roadmap/conductor-view.mjs"
50
+ },
51
+ "./design/scan": {
52
+ "import": "./src/cli/design/scan.mjs"
53
+ },
54
+ "./design/extract-repo": {
55
+ "import": "./src/cli/design/extract-repo.mjs"
56
+ },
57
+ "./design/synthesize": {
58
+ "import": "./src/cli/design/synthesize.mjs"
59
+ }
60
+ },
61
+ "files": [
62
+ "dist/",
63
+ "bin/",
64
+ "src/cli/",
65
+ "src/cost/",
66
+ "commands/",
67
+ "skills/",
68
+ "agents/",
69
+ "prompts/",
70
+ "templates/",
71
+ "context/",
72
+ "workflows/",
73
+ "drivers/",
74
+ "examples/",
75
+ "LICENSE",
76
+ "README.md",
77
+ "CHANGELOG.md",
78
+ "!**/__tests__/**",
79
+ "!**/*.test.*",
80
+ "!**/*.spec.*",
81
+ "!**/*.test.d.ts.map",
82
+ "!**/*.test.js.map"
83
+ ],
84
+ "keywords": [
85
+ "ai",
86
+ "framework",
87
+ "coding-assistant",
88
+ "claude-code",
89
+ "codex",
90
+ "aperant"
91
+ ],
92
+ "license": "AGPL-3.0-only",
93
+ "homepage": "https://github.com/Mikalsen-AI/aperant-cloud-desktop/tree/main/packages/framework#readme",
94
+ "bugs": {
95
+ "url": "https://github.com/Mikalsen-AI/aperant-cloud-desktop/issues"
96
+ },
97
+ "repository": {
98
+ "type": "git",
99
+ "url": "https://github.com/Mikalsen-AI/aperant-cloud-desktop.git",
100
+ "directory": "packages/framework"
101
+ },
102
+ "engines": {
103
+ "node": ">=18.0.0"
104
+ },
105
+ "publishConfig": {
106
+ "access": "public"
107
+ },
108
+ "dependencies": {
109
+ "@clack/prompts": "^1.2.0",
110
+ "proper-lockfile": "^4.1.2",
111
+ "yaml": "^2.8.3",
112
+ "zod": "^4.3.6"
113
+ },
114
+ "optionalDependencies": {
115
+ "@babel/parser": "^7.29.2",
116
+ "@babel/traverse": "^7.29.0",
117
+ "@google/genai": "^1.50.1",
118
+ "css-tree": "^3.2.1",
119
+ "playwright": "^1.59.1"
120
+ },
121
+ "devDependencies": {
122
+ "@vitest/coverage-v8": "^4.1.5"
123
+ },
124
+ "scripts": {
125
+ "build": "tsc && node scripts/extract-personas-schema.mjs",
126
+ "dev": "tsc --watch --preserveWatchOutput",
127
+ "typecheck": "tsc --noEmit",
128
+ "lint": "biome check . --diagnostic-level=error",
129
+ "lint:fix": "biome check --write . --diagnostic-level=error",
130
+ "clean": "rm -rf dist",
131
+ "test": "vitest run",
132
+ "c28:cutover": "node scripts/c28-cutover.mjs",
133
+ "build-plugin": "node scripts/build-plugin.mjs",
134
+ "publish-plugin": "node scripts/publish-plugin.mjs",
135
+ "publish:verdaccio": "node scripts/publish-verdaccio.mjs",
136
+ "release:verdaccio": "pnpm build && pnpm publish:verdaccio",
137
+ "ship:verdaccio": "npm version patch --no-git-tag-version && pnpm build && pnpm publish:verdaccio"
138
+ }
139
+ }
@@ -0,0 +1,17 @@
1
+ Run one read-only clarification turn using Work Record context, prior chat history, and the latest user response.
2
+ Return semantic readiness updates and either the next single focused clarification question or ready status, without mutating project files or external systems.
3
+
4
+ You are the Aperant clarification agent.
5
+ First call readPhaseOutput with phase="triage" to inspect the triage output.
6
+ If triage is already specific and high-confidence, set status="ready" and omit nextChatMessage.
7
+ Otherwise, populate nextChatMessage with EXACTLY ONE focused, concrete question that addresses the highest-impact remaining readiness gap. Do not batch multiple questions into one turn.
8
+ Ground the question in the triage findings, the inbox title and description, and the prior message history. Acknowledge what the user already said when relevant.
9
+ Set nextChatMessage.dimensionKey to the readiness dimension the question targets, and nextChatMessage.cardId to the matching open clarification card when one exists.
10
+ Keep nextClarificationQuestions as the ordered list of remaining open questions (one per open dimension); the UI renders this list as a chip row alongside the chat.
11
+ If the user's prior answer did not raise the targeted dimension's readinessAssessment score above its scoreThreshold, the next question MUST target the same dimensionKey with a sharper or more concrete follow-up. Otherwise, advance to a different open dimension.
12
+ Target the gating dimension whose acceptance-criteria slots are still open; do not jump to a dimension whose slots are already grounded.
13
+ Emit proposedAcceptanceCriteriaUpdates as field-level patches ({ acIndex, fieldPath, value, source, groundedness }) that fill the targeted acceptance-criteria slots from the user's answer; fieldPath is one of statement, given, when, thenOutcome, verificationMethod.
14
+ Mark a slot patch groundedness:'tentative' when you are filling it from a vague answer or your own assumption, and groundedness:'grounded' only when the user's answer concretely specifies the field.
15
+ On an explicit not_applicable reply, do not write a value; on an explicit agent_assume reply, fill the slot with source:'agent_assume'. Otherwise use source:'user_answer'.
16
+ Ask EXACTLY ONE question per turn, and do not re-grill the same dimension more than three turns.
17
+ Use repository tools only when needed to sharpen the question.
@@ -0,0 +1,21 @@
1
+ Refine one Inbox Work Item into structured triage output.
2
+ Use supplied repository evidence and preserve read-only behavior.
3
+ Return semantic findings, readiness evidence, and clarification prompts without mutating project files or external systems.
4
+
5
+ You are the Aperant triage agent.
6
+ Produce structured JSON only via the provided schema.
7
+ Semantic capability mapping: repository_evidence maps to listFiles and readFile tools.
8
+ Use listFiles and readFile tools to ground claims in repository evidence.
9
+ Return a triage dossier with repo-evidenced facts, inferred assumptions, risks, acceptance criteria, and clarification plan.
10
+ Always include readinessEvaluation with rubricVersion, dimensions, missingDimensions, hardBlockers, and justificationSummary.
11
+ Universal readiness keys: problem_clarity, scope_definition, repo_evidence, risk_identification, acceptance_criteria_quality.
12
+ Bug-specific keys: repro_steps, expected_vs_actual, impact_assessment.
13
+ Feature-specific keys: user_value, solution_shape, dependency_mapping.
14
+ Enhancement-specific keys: current_behavior_baseline, incremental_scope, migration_safety.
15
+ Every readiness dimension requires key, score (0-100), evidence, justification, and optional hardBlocker.
16
+ Only place verified repository findings in repoEvidencedFacts.
17
+ For every inferred assumption, set disposition to requires_hitl_confirmation or accepted_assumption.
18
+ Do not present product commitments as facts unless repository evidence directly supports them.
19
+ Each proposed acceptance criterion must include a verificationMethod and Given/When/Then fields when behavior is being specified.
20
+ Tag each proposed acceptance criterion with the readiness dimensionKey it supports (one of the universal or type-specific readiness keys listed above) so the clarification gate can map each acceptance criterion to its dimension exactly.
21
+ Prefer concise summaries and concrete touch points.
@@ -66,10 +66,10 @@ The reviewer writes `qa_report.md` and updates `implementation_plan.json` with a
66
66
 
67
67
  Read the `qa_signoff` from `implementation_plan.json`. The reviewer now writes dimension scores alongside the status.
68
68
 
69
- Read the dimension scores:
70
- - If ALL dimensions >= 7 and status is "approved" -> Build passes. Write final QA report. Done.
71
- - If ALL dimensions >= 5 and status is "approved-with-notes" -> Accept with notes. Write final QA report with improvement suggestions. Done.
72
- - If ANY dimension < 5 -> Analyze which dimensions are lowest (Phase 4)
69
+ Read the gates + dimension scores:
70
+ - If `automation_gate: pass` AND `proof_gate: pass` AND status is "approved" -> Build passes. Write final QA report. Done.
71
+ - If `automation_gate: pass` AND `proof_gate: fail` AND status is "needs_human" -> Transport gap. Write final QA report listing what the human must install (e.g. an MCP server). Done.
72
+ - If `automation_gate: fail` OR critical findings unresolved -> status is "rejected". Spawn fixer (Phase 4).
73
73
  - If no scores written -> Reviewer failed to score. Re-spawn with explicit scoring instructions: "You MUST score all 4 dimensions (completeness, correctness, code_quality, test_coverage) on 1-10 before writing a verdict."
74
74
  - If no signoff written at all -> Reviewer failed to update the file. Retry with explicit instructions.
75
75
 
@@ -100,10 +100,10 @@ When the reviewer rejects, triage based on dimension scores from the qa_signoff,
100
100
  - Documentation formatting
101
101
  - Non-functional improvements
102
102
 
103
- **Decision Framework:**
104
- - If ONLY cosmetic issues and ALL dimension scores >= 5 -> approve with notes (write qa_signoff: approved-with-notes)
105
- - If ALL dimension scores >= 7 and no critical issues -> approve the build (write qa_signoff: approved)
106
- - If ANY dimension < 5 -> spawn qa_fixer with targeted guidance focused on the lowest-scoring dimension
103
+ **Decision Framework (v0.9.0 two-gate envelope):**
104
+ - If `automation_gate: pass` AND `proof_gate: pass` AND no critical issues -> approve the build (write qa_signoff: approved)
105
+ - If `automation_gate: pass` AND `proof_gate: fail` (UI-surface outcome missing driver transport) -> write qa_signoff: needs_human with a `transport_gap` array
106
+ - If `automation_gate: fail` OR critical issues unresolved -> spawn qa_fixer with targeted guidance
107
107
  - If the same critical issue appears 3+ times -> escalate to human
108
108
 
109
109
  ### Phase 5: Fix Cycle
@@ -137,19 +137,20 @@ Track iteration count. Your goal is to converge quickly:
137
137
 
138
138
  ## QUALITY GATES
139
139
 
140
- ### Approval Criteria (Score-Based)
140
+ ### Approval Criteria (v0.9.0 two-gate envelope)
141
141
  Approve when ALL of these are true:
142
- - All 4 dimension scores >= 7 (for "approved") or >= 5 (for "approved-with-notes")
142
+ - `automation_gate: pass` (tests + typecheck + lint all green)
143
+ - `proof_gate: pass` (every outcome has surface-appropriate evidence)
143
144
  - No critical issues in the issues array
144
- - Automated checks (tests, typecheck, lint) all pass
145
+ - Dimensions land >= 7 as informational rationale (does NOT drive the verdict)
145
146
 
146
- ### Score Thresholds
147
- - **approved**: ALL dimensions >= 7 AND no critical issues
148
- - **approved-with-notes**: ALL dimensions >= 5 AND no critical issues
149
- - **rejected**: ANY dimension < 5 OR critical issues found
147
+ ### Verdict Closed Set
148
+ - **approved**: `automation_gate: pass` AND `proof_gate: pass` AND no critical issues
149
+ - **needs_human**: `automation_gate: pass` AND `proof_gate: fail` (transport gap)
150
+ - **rejected**: `automation_gate: fail` OR critical issues unresolved
150
151
 
151
- ### Acceptable Imperfections (for approved-with-notes)
152
- These should NOT block approval when all dimensions are >= 5:
152
+ ### Acceptable Imperfections (cited in `findings.notes` on an `approved` verdict)
153
+ These do NOT block approval and ride along as notes:
153
154
  - Missing optional features (if spec marks them as optional)
154
155
  - Code style deviations (if functionality is correct)
155
156
  - Missing edge case handling for unlikely scenarios
@@ -37,13 +37,15 @@ You MUST score 4 dimensions on a 1-10 scale. The verdict is DERIVED from scores
37
37
  **3-4 (Poor):** Significant problems. Multiple issues.
38
38
  **1-2 (Failed):** Fundamentally broken or missing.
39
39
 
40
- ### Verdict Derivation (NOT your choice -- derived from scores)
40
+ ### Verdict Derivation (v0.9.0 two-gate envelope; NOT your choice -- derived from gates)
41
41
 
42
- - **approved**: ALL dimensions >= 7 AND no critical issues
43
- - **approved-with-notes**: ALL dimensions >= 5 AND no critical issues
44
- - **rejected**: ANY dimension < 5 OR critical issues found
42
+ Verdict is the closed set `{approved, rejected, needs_human}`. It derives from the two-gate envelope (`automation_gate` AND `proof_gate`) per `/apt:verify-proof`. Dimensions are informational rationale only.
45
43
 
46
- You MUST write scores BEFORE writing the verdict. The verdict follows from the scores.
44
+ - **approved**: `automation_gate: pass` AND `proof_gate: pass` AND no critical findings.
45
+ - **needs_human**: `automation_gate: pass` AND `proof_gate: fail` (typically: UI-surface outcome with no driver transport — see verify-proof workflow).
46
+ - **rejected**: `automation_gate: fail` OR critical findings unresolved.
47
+
48
+ You MUST write scores BEFORE writing the verdict. The verdict follows from the gates, with dimensions as rationale.
47
49
 
48
50
  ---
49
51
 
@@ -440,7 +442,7 @@ Create a comprehensive QA report with dimension scores:
440
442
  | test_coverage | {N}/10 | {evidence} |
441
443
 
442
444
  **Minimum score:** {min}
443
- **Derived verdict:** {approved|approved-with-notes|rejected}
445
+ **Derived verdict:** {approved|rejected|needs_human}
444
446
 
445
447
  ## Summary
446
448
 
@@ -514,7 +516,7 @@ For each critical/major issue, describe what the Coder Agent should do:
514
516
 
515
517
  **Next Steps**:
516
518
  - [If approved: Ready for merge]
517
- - [If approved-with-notes: List notes for future improvement]
519
+ - [If needs_human: Install the missing driver transport (e.g. MCP server) and re-run /apt:verify-proof]
518
520
  - [If rejected: List of fixes needed, then re-run QA]
519
521
  ```
520
522
 
@@ -566,17 +568,17 @@ EOF
566
568
  # Only commit actual code changes to the project
567
569
  ```
568
570
 
569
- ### If APPROVED-WITH-NOTES:
571
+ ### If NEEDS_HUMAN (transport gap):
570
572
 
571
- Same as approved, but with status "approved-with-notes" and an additional `notes` array:
573
+ Same as approved, but with status `"needs_human"` and a `transport_gap` array describing what the human must install (e.g. an MCP server, a binary):
572
574
 
573
575
  ```json
574
576
  {
575
577
  "qa_signoff": {
576
- "status": "approved-with-notes",
577
- "notes": [
578
- "Minor issue: [description]",
579
- "Suggestion: [description]"
578
+ "status": "needs_human",
579
+ "transport_gap": [
580
+ "Missing MCP server: puppeteer (drivers/browser/manifest.json :: transport.mcp_server_id)",
581
+ "After install, re-run /apt:verify-proof"
580
582
  ],
581
583
  "dimension_scores": {
582
584
  "completeness": "[N]",
@@ -762,11 +764,11 @@ QA will automatically re-run after fixes.
762
764
 
763
765
  The QA -> Fix -> QA loop continues until:
764
766
 
765
- 1. **All dimension scores >= 7** (for approved) or **>= 5** (for approved-with-notes)
767
+ 1. **`automation_gate: pass`** (lint + typecheck + tests all green) AND **`proof_gate: pass`** (every outcome has surface-appropriate evidence)
766
768
  2. **No critical issues remain**
767
769
  3. **All tests pass**
768
770
  4. **No regressions**
769
- 5. **QA derives approved or approved-with-notes verdict**
771
+ 5. **QA derives `approved`** (the only ship-eligible verdict; `needs_human` requires installing the missing transport, `rejected` requires code fixes)
770
772
 
771
773
  Maximum iterations: 5 (configurable)
772
774
 
@@ -687,10 +687,10 @@ When spawning agents, follow these rules:
687
687
  3. **Agent type from route result.** The `agent` field in the route JSON tells you which agent to spawn.
688
688
  4. **Model selection:** Use `sonnet` for agents unless the task is complex (DEEP track), then use the default model.
689
689
  5. **Always include task_dir.** Every agent needs to know where to read/write artifacts.
690
- 6. **Capability-based spawning:** Before spawning agents for task mode (execution_mode = "auto"), check the reconciled orchestration mode:
690
+ 6. **Capability-based spawning:** Before spawning agents for task mode (execution_mode = "auto"), check the reconciled orchestration mode. Pass the task's `{track}` (from Step 0c) via `--track` so per-track defaults from `.aperant/config.json:orchestration.per_track` apply — without it, a STANDARD task whose configured mode is `sequential` silently resolves to the host's most-capable mode (e.g. `agent-team`) and over-delegates:
691
691
 
692
692
  ```bash
693
- node packages/framework/bin/apt-tools.mjs reconcile .
693
+ node packages/framework/bin/apt-tools.mjs reconcile . --track {track}
694
694
  ```
695
695
 
696
696
  Use `resolved.phase_delegation` to decide how agents are launched: