@jaimevalasek/aioson 1.33.1 → 1.37.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.
Files changed (162) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/docs/en/1-understand/ecosystem-map.md +45 -29
  3. package/docs/en/1-understand/glossary.md +6 -6
  4. package/docs/en/1-understand/what-is-aioson.md +5 -5
  5. package/docs/en/2-start/existing-project.md +7 -7
  6. package/docs/en/2-start/first-project.md +33 -39
  7. package/docs/en/2-start/initial-decisions.md +22 -19
  8. package/docs/en/3-recipes/README.md +2 -2
  9. package/docs/en/3-recipes/continuity-between-sessions.md +2 -2
  10. package/docs/en/3-recipes/from-idea-to-prd-via-briefing.md +13 -3
  11. package/docs/en/3-recipes/full-feature-with-sheldon.md +329 -338
  12. package/docs/en/4-agents/README.md +33 -16
  13. package/docs/en/4-agents/briefing-refiner.md +146 -0
  14. package/docs/en/4-agents/discovery-design-doc.md +20 -8
  15. package/docs/en/4-agents/forge-run.md +3 -2
  16. package/docs/en/5-reference/README.md +1 -0
  17. package/docs/en/5-reference/autopilot-handoff.md +286 -0
  18. package/docs/en/5-reference/cli-reference.md +57 -48
  19. package/docs/en/5-reference/executable-verification.md +10 -7
  20. package/docs/en/5-reference/parallel.md +2 -0
  21. package/docs/en/5-reference/qa-browser.md +2 -2
  22. package/docs/en/README.md +3 -3
  23. package/docs/pt/1-entender/glossario.md +5 -5
  24. package/docs/pt/1-entender/mapa-do-ecossistema.md +33 -22
  25. package/docs/pt/2-comecar/decisoes-iniciais.md +20 -18
  26. package/docs/pt/2-comecar/primeiro-projeto.md +2 -2
  27. package/docs/pt/3-receitas/README.md +1 -1
  28. package/docs/pt/3-receitas/app-saas-do-zero.md +35 -122
  29. package/docs/pt/3-receitas/da-ideia-ao-prd-via-briefing.md +8 -1
  30. package/docs/pt/3-receitas/feature-completa-com-sheldon.md +291 -338
  31. package/docs/pt/4-agentes/README.md +13 -11
  32. package/docs/pt/4-agentes/analyst.md +9 -5
  33. package/docs/pt/4-agentes/architect.md +9 -5
  34. package/docs/pt/4-agentes/briefing-refiner.md +64 -40
  35. package/docs/pt/4-agentes/briefing.md +6 -1
  36. package/docs/pt/4-agentes/dev.md +38 -8
  37. package/docs/pt/4-agentes/deyvin.md +4 -0
  38. package/docs/pt/4-agentes/discover.md +4 -0
  39. package/docs/pt/4-agentes/discovery-design-doc.md +25 -23
  40. package/docs/pt/4-agentes/neo.md +4 -0
  41. package/docs/pt/4-agentes/orache.md +6 -0
  42. package/docs/pt/4-agentes/orchestrator.md +176 -118
  43. package/docs/pt/4-agentes/pentester.md +11 -5
  44. package/docs/pt/4-agentes/pm.md +15 -7
  45. package/docs/pt/4-agentes/product.md +19 -1
  46. package/docs/pt/4-agentes/qa.md +10 -2
  47. package/docs/pt/4-agentes/setup.md +3 -1
  48. package/docs/pt/4-agentes/sheldon.md +178 -99
  49. package/docs/pt/4-agentes/tester.md +6 -0
  50. package/docs/pt/4-agentes/ux-ui.md +9 -5
  51. package/docs/pt/5-referencia/README.md +1 -1
  52. package/docs/pt/5-referencia/agent-chain-continuity.md +14 -5
  53. package/docs/pt/5-referencia/autopilot-handoff.md +191 -74
  54. package/docs/pt/5-referencia/comandos-cli.md +16 -7
  55. package/docs/pt/5-referencia/sdd-automation-scripts.md +6 -6
  56. package/docs/pt/5-referencia/sdd-framework.md +53 -16
  57. package/docs/pt/5-referencia/sdd-planos-e-estrutura.md +27 -15
  58. package/docs/pt/5-referencia/skills.md +2 -0
  59. package/docs/pt/README.md +4 -4
  60. package/docs/pt/agentes.md +50 -50
  61. package/package.json +2 -2
  62. package/src/agents.js +1 -1
  63. package/src/artifact-kinds.js +111 -0
  64. package/src/autopilot-signal.js +71 -0
  65. package/src/cli.js +112 -81
  66. package/src/commands/agent-epilogue.js +251 -186
  67. package/src/commands/agents.js +122 -50
  68. package/src/commands/audit-code.js +344 -0
  69. package/src/commands/briefing.js +337 -1
  70. package/src/commands/classify.js +389 -389
  71. package/src/commands/feature-close.js +122 -4
  72. package/src/commands/harness-check.js +259 -175
  73. package/src/commands/live.js +71 -11
  74. package/src/commands/review-feature.js +189 -0
  75. package/src/commands/runtime.js +81 -66
  76. package/src/commands/sync-agents-copy.js +115 -0
  77. package/src/commands/update.js +5 -1
  78. package/src/commands/verification-plan.js +143 -0
  79. package/src/commands/verify-artifact.js +593 -0
  80. package/src/commands/workflow-execute.js +434 -316
  81. package/src/commands/workflow-next.js +193 -20
  82. package/src/commands/workflow-plan.js +5 -5
  83. package/src/constants.js +2 -0
  84. package/src/doctor.js +4 -2
  85. package/src/gateway-pointer-merge.js +7 -1
  86. package/src/handoff-contract.js +267 -172
  87. package/src/harness/contract-integrity-gate.js +172 -0
  88. package/src/harness/contract-integrity.js +111 -0
  89. package/src/harness/contract-schema.js +377 -332
  90. package/src/harness/detect-runtime-feature.js +90 -0
  91. package/src/harness/static-criteria.js +192 -0
  92. package/src/i18n/messages/en.js +10 -5
  93. package/src/i18n/messages/es.js +10 -5
  94. package/src/i18n/messages/fr.js +10 -5
  95. package/src/i18n/messages/pt-BR.js +10 -5
  96. package/src/install-wizard.js +8 -8
  97. package/src/installer.js +13 -6
  98. package/src/lib/briefing-refiner/apply-feedback.js +18 -4
  99. package/src/lib/briefing-refiner/feedback-schema.js +73 -4
  100. package/src/lib/briefing-refiner/refinement-report.js +11 -0
  101. package/src/lib/briefing-refiner/review-html.js +388 -68
  102. package/src/parser.js +12 -0
  103. package/src/preflight-engine.js +12 -12
  104. package/src/verification/policy-engine.js +95 -95
  105. package/src/verification-policy.js +398 -0
  106. package/src/version.js +52 -1
  107. package/template/.aioson/agents/architect.md +34 -5
  108. package/template/.aioson/agents/briefing-refiner.md +91 -48
  109. package/template/.aioson/agents/briefing.md +4 -0
  110. package/template/.aioson/agents/committer.md +2 -1
  111. package/template/.aioson/agents/copywriter.md +30 -21
  112. package/template/.aioson/agents/design-hybrid-forge.md +10 -1
  113. package/template/.aioson/agents/dev.md +35 -23
  114. package/template/.aioson/agents/deyvin.md +4 -0
  115. package/template/.aioson/agents/discover.md +16 -3
  116. package/template/.aioson/agents/discovery-design-doc.md +7 -2
  117. package/template/.aioson/agents/genome.md +19 -10
  118. package/template/.aioson/agents/neo.md +34 -30
  119. package/template/.aioson/agents/orache.md +24 -11
  120. package/template/.aioson/agents/orchestrator.md +100 -7
  121. package/template/.aioson/agents/pentester.md +4 -0
  122. package/template/.aioson/agents/pm.md +8 -8
  123. package/template/.aioson/agents/product.md +25 -1
  124. package/template/.aioson/agents/profiler-enricher.md +20 -11
  125. package/template/.aioson/agents/profiler-forge.md +20 -11
  126. package/template/.aioson/agents/profiler-researcher.md +20 -11
  127. package/template/.aioson/agents/qa.md +96 -31
  128. package/template/.aioson/agents/setup.md +12 -1
  129. package/template/.aioson/agents/sheldon.md +103 -13
  130. package/template/.aioson/agents/site-forge.md +11 -2
  131. package/template/.aioson/agents/squad.md +20 -5
  132. package/template/.aioson/agents/tester.md +4 -0
  133. package/template/.aioson/agents/ux-ui.md +2 -1
  134. package/template/.aioson/agents/validator.md +33 -1
  135. package/template/.aioson/config/verification.json +61 -0
  136. package/template/.aioson/config.md +13 -9
  137. package/template/.aioson/docs/LAYERS.md +2 -2
  138. package/template/.aioson/docs/agent-help.md +126 -0
  139. package/template/.aioson/docs/autopilot-handoff.md +30 -20
  140. package/template/.aioson/docs/dev/execution-discipline.md +41 -0
  141. package/template/.aioson/docs/dev/phase-loop.md +50 -0
  142. package/template/.aioson/docs/play/llm-data-and-bindings.md +70 -7
  143. package/template/.aioson/docs/presets/workflow.config.full-merged.json +15 -0
  144. package/template/.aioson/docs/presets/workflow.config.lean.json +15 -0
  145. package/template/.aioson/docs/product/prd-contract.md +12 -12
  146. package/template/.aioson/docs/prototype-contract.md +21 -4
  147. package/template/.aioson/docs/reference-identity.md +94 -0
  148. package/template/.aioson/docs/sheldon/harness-contract.md +155 -28
  149. package/template/.aioson/docs/verification-config.md +82 -0
  150. package/template/.aioson/docs/verify-artifact-gates.md +91 -0
  151. package/template/.aioson/docs/workflow-lean-lane.md +129 -0
  152. package/template/.aioson/skills/design/interface-design/SKILL.md +17 -0
  153. package/template/.aioson/skills/design/interface-design/references/intent-and-domain.md +2 -0
  154. package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +16 -14
  155. package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +2 -2
  156. package/template/.aioson/skills/process/aioson-spec-driven/references/classification-map.md +4 -4
  157. package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +15 -15
  158. package/template/.aioson/skills/process/prototype-forge/SKILL.md +6 -0
  159. package/template/.aioson/skills/process/reference-identity-extract/SKILL.md +164 -0
  160. package/template/.aioson/skills/static/multi-agent-patterns.md +5 -5
  161. package/template/AGENTS.md +36 -36
  162. package/template/CLAUDE.md +15 -11
@@ -5,6 +5,7 @@ const { detectFramework } = require('../detector');
5
5
  const { updateInstallation } = require('../updater');
6
6
  const { validateProjectContextFile, getInteractionLanguage } = require('../context');
7
7
  const { applyAgentLocale } = require('../locales');
8
+ const { getCliVersionLabelSync } = require('../version');
8
9
 
9
10
  async function runUpdate({ args, options, logger, t }) {
10
11
  const targetDir = path.resolve(process.cwd(), args[0] || '.');
@@ -36,10 +37,13 @@ async function runUpdate({ args, options, logger, t }) {
36
37
  (result.savedProfile && result.savedProfile.locale
37
38
  ? result.savedProfile.locale
38
39
  : 'en');
39
- localeSync = await applyAgentLocale(targetDir, language, { dryRun, selectiveUpdate: selective && !all });
40
+ localeSync = await applyAgentLocale(targetDir, language, { dryRun, selectiveUpdate: selective && !all });
40
41
  }
41
42
 
42
43
  logger.log(t('update.done_at', { targetDir }));
44
+ // Surface WHICH template landed — stale-template updates used to be silent
45
+ // (the copy comes from the installed CLI's own bundle, not from npm latest).
46
+ logger.log(t('update.template_version', { version: getCliVersionLabelSync() }));
43
47
  logger.log(t('update.files_updated', { count: result.copied.length }));
44
48
  logger.log(t('update.backups_created', { count: result.backedUp.length }));
45
49
  if (result.migrations && result.migrations.profileRename && result.migrations.profileRename.changed) {
@@ -0,0 +1,143 @@
1
+ 'use strict';
2
+
3
+ // `aioson verification:plan` — deterministic bridge between verification.json and
4
+ // the agents. Given a slug + trigger + run context, it resolves WHICH verification
5
+ // sub-agents should run, on WHICH host/model, and the phase-loop settings — so
6
+ // @dev (per-phase) and the post-dev cycle (end-of-feature) follow a computed plan
7
+ // instead of re-interpreting the config in prose. Read-only; never mutates state.
8
+
9
+ const fs = require('node:fs/promises');
10
+ const path = require('node:path');
11
+ const {
12
+ readVerificationConfig,
13
+ resolveHost,
14
+ getAgentDispatch,
15
+ shouldRunForTrigger,
16
+ resolveAgentReportPath,
17
+ getCrossCheck,
18
+ getBudget,
19
+ getPhaseLoop,
20
+ VERIFICATION_AGENTS,
21
+ TRIGGERS
22
+ } = require('../verification-policy');
23
+
24
+ const BAR = '─'.repeat(60);
25
+ const CLASSIFICATIONS = ['MICRO', 'SMALL', 'MEDIUM'];
26
+
27
+ // A loud, deterministic instruction the phase loop echoes back to @dev at every
28
+ // phase boundary. On a per-phase trigger with auto_continue it is the fresh
29
+ // tool-result that stops the agent from ending its turn to "report" after a
30
+ // phase — the exact failure the phase loop exists to prevent. It never tells the
31
+ // agent to /compact: context is shed transparently by the host's auto-compact,
32
+ // without ending the turn.
33
+ function buildContinuationDirective(trigger, phaseLoop) {
34
+ if (trigger === 'end-of-feature') {
35
+ return 'END-OF-FEATURE — last phase: run the full runtime smoke (build + migrate + boot + Core happy-path), then hand off through the post-dev review cycle. Do not close/publish — that is the human gate.';
36
+ }
37
+ if (phaseLoop && phaseLoop.auto_continue) {
38
+ return 'CONTINUE-NOW — a clean report is a checkpoint, not a stop. Go DIRECTLY into the next phase in this same turn: do not stop, do not ask "continue?", do not summarize-and-end, and never self-issue /compact (the host auto-compacts transparently). Halt only on a failing gate/verification after retries or a genuine hard stop.';
39
+ }
40
+ return 'PAUSE — auto_continue is off: after this phase report, stop and wait for confirmation before the next phase.';
41
+ }
42
+
43
+ async function readFileSafe(filePath) {
44
+ try {
45
+ return await fs.readFile(filePath, 'utf8');
46
+ } catch {
47
+ return null;
48
+ }
49
+ }
50
+
51
+ // Best-effort classification: prd-{slug}.md frontmatter wins, then project.context.md.
52
+ async function detectClassification(targetDir, slug) {
53
+ const dir = path.join(targetDir, '.aioson', 'context');
54
+ const candidates = [];
55
+ if (slug) candidates.push(path.join(dir, `prd-${slug}.md`));
56
+ candidates.push(path.join(dir, 'project.context.md'));
57
+ for (const file of candidates) {
58
+ const text = await readFileSafe(file);
59
+ if (!text) continue;
60
+ const m = text.match(/^\s*classification:\s*["']?([A-Za-z]+)["']?\s*$/m);
61
+ if (m && CLASSIFICATIONS.includes(m[1].toUpperCase())) return m[1].toUpperCase();
62
+ }
63
+ return null;
64
+ }
65
+
66
+ async function runVerificationPlan({ args, options = {}, logger }) {
67
+ const targetDir = path.resolve(process.cwd(), args[0] || '.');
68
+ const slug = (options.feature || options.slug || '').toString().trim() || null;
69
+
70
+ const triggerRaw = (options.trigger || 'per-phase').toString().trim().toLowerCase();
71
+ // An unknown trigger must fail loudly. Silently coercing it to per-phase used
72
+ // to emit an imperative CONTINUE-NOW directive on what was actually a typo'd
73
+ // end-of-feature call — steering @dev into a phase that does not exist.
74
+ if (!TRIGGERS.includes(triggerRaw)) {
75
+ const failure = { ok: false, reason: 'invalid_trigger', trigger: triggerRaw, valid_triggers: [...TRIGGERS] };
76
+ if (options.json) return failure;
77
+ logger.error(`Invalid --trigger=${triggerRaw}. Valid triggers: ${TRIGGERS.join(', ')}.`);
78
+ return failure;
79
+ }
80
+ const trigger = triggerRaw;
81
+
82
+ const config = await readVerificationConfig(targetDir);
83
+ const host = resolveHost(config, options.host);
84
+
85
+ let classification = (options.classification || '').toString().trim().toUpperCase();
86
+ if (!CLASSIFICATIONS.includes(classification)) {
87
+ classification = (await detectClassification(targetDir, slug)) || 'SMALL';
88
+ }
89
+ const sensitiveSurface = Boolean(options.sensitive);
90
+
91
+ const context = { trigger, classification, sensitiveSurface };
92
+ const agents = [];
93
+ for (const agentId of VERIFICATION_AGENTS) {
94
+ const dispatch = getAgentDispatch(config, agentId, host);
95
+ const entry = {
96
+ agent: agentId,
97
+ run: shouldRunForTrigger(config, agentId, context),
98
+ mode: dispatch ? dispatch.mode : 'native',
99
+ model: dispatch ? dispatch.model : 'configured-default',
100
+ report: resolveAgentReportPath(config, agentId, slug || '{slug}')
101
+ };
102
+ if (agentId === 'validator') {
103
+ const cc = getCrossCheck(config, agentId);
104
+ if (cc) entry.cross_check = cc;
105
+ }
106
+ agents.push(entry);
107
+ }
108
+
109
+ const result = {
110
+ ok: true,
111
+ feature_slug: slug,
112
+ host,
113
+ trigger,
114
+ classification,
115
+ sensitive_surface: sensitiveSurface,
116
+ agents,
117
+ phase_loop: getPhaseLoop(config),
118
+ budget: getBudget(config)
119
+ };
120
+ result.continuation_directive = buildContinuationDirective(trigger, result.phase_loop);
121
+
122
+ if (options.json) return result;
123
+
124
+ logger.log('');
125
+ logger.log(`Verification plan${slug ? ` — ${slug}` : ''}`);
126
+ logger.log(BAR);
127
+ logger.log(`Host: ${host} Trigger: ${trigger} Class: ${classification}${sensitiveSurface ? ' [sensitive]' : ''}`);
128
+ logger.log(BAR);
129
+ for (const a of agents) {
130
+ const mark = a.run ? 'RUN ' : 'skip';
131
+ const cc = a.cross_check && a.cross_check.enabled ? ` + cross_check(${a.cross_check.tool}/${a.cross_check.model})` : '';
132
+ logger.log(` [${mark}] ${a.agent.padEnd(10)} ${a.mode}/${a.model}${a.run ? ` → ${a.report}` : ''}${cc}`);
133
+ }
134
+ logger.log(BAR);
135
+ const pl = result.phase_loop;
136
+ logger.log(`Phase loop: auto_continue=${pl.auto_continue} compact_between_phases=${pl.compact_between_phases} max_fix_retries=${pl.max_fix_retries_per_phase}`);
137
+ logger.log(`▶ ${result.continuation_directive}`);
138
+ logger.log('');
139
+
140
+ return result;
141
+ }
142
+
143
+ module.exports = { runVerificationPlan };