chati-dev 4.5.16 → 4.5.28

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 (122) hide show
  1. package/README.md +8 -3
  2. package/bin/chati.js +124 -66
  3. package/framework/agents/build/dev.md +5 -5
  4. package/framework/agents/deploy/devops.md +7 -7
  5. package/framework/agents/discover/brief.md +4 -4
  6. package/framework/agents/discover/brownfield-wu.md +3 -3
  7. package/framework/agents/discover/greenfield-wu.md +3 -3
  8. package/framework/agents/plan/architect.md +2 -2
  9. package/framework/agents/plan/detail.md +4 -4
  10. package/framework/agents/plan/phases.md +2 -2
  11. package/framework/agents/plan/tasks.md +2 -2
  12. package/framework/agents/plan/ux.md +2 -2
  13. package/framework/agents/quality/qa-implementation.md +11 -10
  14. package/framework/agents/quality/qa-planning.md +3 -3
  15. package/framework/agents/quality/qa-visual.md +1 -1
  16. package/framework/config.yaml +3 -3
  17. package/framework/constitution.md +18 -18
  18. package/framework/context/protocols.md +1 -1
  19. package/framework/context/quality.md +1 -1
  20. package/framework/context/root.md +4 -4
  21. package/framework/data/entity-registry.yaml +1 -1
  22. package/framework/domains/agents/orchestrator.yaml +2 -2
  23. package/framework/domains/constitution.yaml +1 -1
  24. package/framework/hooks/advance-trigger.js +4 -6
  25. package/framework/hooks/git-push-authority.js +45 -37
  26. package/framework/hooks/mode-governance.js +149 -40
  27. package/framework/hooks/model-governance.js +13 -20
  28. package/framework/hooks/prism-engine.js +74 -92
  29. package/framework/hooks/reasoning-escalator.js +23 -40
  30. package/framework/hooks/session-digest.js +12 -13
  31. package/framework/hooks/session-reader.js +224 -0
  32. package/framework/hooks/session-writer.js +195 -0
  33. package/framework/hooks/team-quality-gate.js +34 -24
  34. package/framework/i18n/en.yaml +2 -2
  35. package/framework/i18n/es.yaml +2 -2
  36. package/framework/i18n/fr.yaml +2 -2
  37. package/framework/i18n/pt.yaml +2 -2
  38. package/framework/intelligence/context-engine.md +4 -4
  39. package/framework/intelligence/memory-layer.md +1 -1
  40. package/framework/manifest.json +129 -119
  41. package/framework/manifest.sig +1 -1
  42. package/framework/orchestrator/chati-router.js +252 -25
  43. package/framework/orchestrator/chati.md +238 -70
  44. package/framework/schemas/session.schema.json +1 -1
  45. package/framework/tasks/orchestrator-deviation.md +1 -1
  46. package/framework/tasks/orchestrator-escalate.md +1 -1
  47. package/framework/tasks/orchestrator-handoff.md +6 -6
  48. package/framework/tasks/orchestrator-health.md +5 -9
  49. package/framework/tasks/orchestrator-mode-switch.md +3 -7
  50. package/framework/tasks/orchestrator-resume.md +10 -14
  51. package/framework/tasks/orchestrator-route.md +3 -3
  52. package/framework/tasks/orchestrator-spawn-terminal.md +1 -1
  53. package/framework/tasks/orchestrator-status.md +9 -9
  54. package/framework/tasks/orchestrator-suggest-mode.md +1 -1
  55. package/framework/tasks/qa-impl-consolidate.md +2 -2
  56. package/framework/tasks/qa-impl-performance-test.md +4 -4
  57. package/framework/tasks/qa-impl-regression-check.md +4 -4
  58. package/framework/tasks/qa-impl-sast-scan.md +1 -1
  59. package/framework/tasks/qa-impl-test-execute.md +1 -1
  60. package/framework/tasks/qa-impl-verdict.md +2 -2
  61. package/framework/tasks/qa-planning-consolidate.md +3 -3
  62. package/framework/tasks/qa-planning-coverage-plan.md +2 -2
  63. package/framework/tasks/qa-planning-gate-define.md +4 -4
  64. package/framework/tasks/qa-planning-risk-matrix.md +4 -4
  65. package/framework/tasks/qa-planning-test-strategy.md +2 -2
  66. package/node_modules/@chati/browser-capability/src/index.js +12 -2
  67. package/node_modules/@chati/planning/src/index.js +24 -4
  68. package/node_modules/@chati/provider-registry/src/index.js +11 -0
  69. package/node_modules/@chati/rail/src/index.js +1967 -83
  70. package/node_modules/@chati/release-lane/README.md +12 -8
  71. package/node_modules/@chati/release-lane/package.json +1 -1
  72. package/node_modules/@chati/release-lane/src/index.js +1426 -58
  73. package/node_modules/@chati/review-council/src/index.js +63 -0
  74. package/node_modules/@chati/tracking-clickup/README.md +13 -0
  75. package/node_modules/@chati/tracking-clickup/src/index.js +690 -30
  76. package/package-artifact-manifest.json +1 -0
  77. package/package-artifact-manifest.sig +1 -0
  78. package/package.json +16 -7
  79. package/scripts/verify-real-harness-e2e.js +1581 -0
  80. package/src/config/framework-adapter.js +4 -4
  81. package/src/installer/core.js +148 -53
  82. package/src/installer/manifest.js +140 -9
  83. package/src/installer/package-artifact.js +249 -0
  84. package/src/installer/templates.js +65 -20
  85. package/src/installer-v2/catalog-client.js +531 -23
  86. package/src/installer-v2/index.js +91 -34
  87. package/src/installer-v2/installation-authority.js +327 -0
  88. package/src/installer-v2/provider-executable.js +247 -0
  89. package/src/installer-v2/wizard-installation.js +1 -1
  90. package/src/orchestrator/browser-runtime.js +44 -13
  91. package/src/orchestrator/cli.js +1545 -174
  92. package/src/orchestrator/clickup-projection.js +43 -1
  93. package/src/orchestrator/clickup-runtime.js +355 -39
  94. package/src/orchestrator/doctor.js +16 -3
  95. package/src/orchestrator/index.js +16 -0
  96. package/src/orchestrator/planning-runtime.js +20 -2
  97. package/src/orchestrator/rail-adjudication-evidence.js +234 -0
  98. package/src/orchestrator/rail-evidence-authority.js +147 -0
  99. package/src/orchestrator/rail-execution-evidence.js +45 -0
  100. package/src/orchestrator/rail-runtime.js +836 -56
  101. package/src/orchestrator/release-runtime.js +65 -6
  102. package/src/orchestrator/review-runtime.js +186 -41
  103. package/src/orchestrator/runtime-installation-v2.js +236 -20
  104. package/src/orchestrator/session-manager.js +1167 -53
  105. package/src/terminal/adapters/claude-adapter.js +3 -1
  106. package/src/terminal/adapters/codex-adapter.js +2 -0
  107. package/src/terminal/adapters/grok-adapter.js +7 -4
  108. package/src/terminal/handoff-parser.js +19 -1
  109. package/src/terminal/prompt-builder.js +9 -1
  110. package/src/terminal/provider-preflight.js +36 -3
  111. package/src/terminal/rail-execution-worktree.js +213 -0
  112. package/src/terminal/rail-prompts.js +169 -0
  113. package/src/terminal/rail-readonly-workspace.js +324 -0
  114. package/src/terminal/run-agent.js +384 -24
  115. package/src/terminal/run-parallel.js +5 -0
  116. package/src/terminal/run-rail-adjudication.js +323 -0
  117. package/src/terminal/run-rail-review.js +291 -0
  118. package/src/terminal/run-rail-rework.js +325 -0
  119. package/src/terminal/run-rail-task.js +380 -0
  120. package/src/terminal/run-team.js +5 -0
  121. package/src/terminal/spawner.js +1225 -77
  122. package/src/wizard/index.js +3 -2
@@ -79,6 +79,9 @@ export function validateReviewRecord(review) {
79
79
  if (review.findings.some((finding) => finding.disposition === 'accepted') && review.verdict !== 'rework') {
80
80
  fail('ACCEPTED_FINDINGS_REQUIRE_REWORK', 'any accepted finding requires verdict rework');
81
81
  }
82
+ if (review.verdict === 'rework' && !review.findings.some((finding) => finding.disposition === 'accepted')) {
83
+ fail('REWORK_REQUIRES_ACCEPTED_FINDING', 'verdict rework requires at least one accepted finding');
84
+ }
82
85
  assertObject(review.impasse, 'INVALID_REVIEW_IMPASSE', 'impasse');
83
86
  if (!IMPASSE_KINDS.has(review.impasse.kind)) fail('INVALID_REVIEW_IMPASSE', 'impasse.kind is invalid');
84
87
  if (review.impasse.kind === 'technical') assertRef(review.impasse.evidence_ref, 'INVALID_REVIEW_IMPASSE', 'impasse.evidence_ref');
@@ -103,6 +106,66 @@ export function computeIndependenceLevel({ builder_identity, reviewer_identity }
103
106
  return 'C';
104
107
  }
105
108
 
109
+ const REVIEW_REASONING = Object.freeze(['low', 'medium', 'high', 'xhigh', 'max']);
110
+
111
+ function nearestReviewReasoning(binding, model) {
112
+ const preferred = model.tier === 'worker' ? 'low' : 'high';
113
+ const maximumRank = REVIEW_REASONING.indexOf(model.highest_reasoning_configuration || 'xhigh');
114
+ const preferredRank = REVIEW_REASONING.indexOf(preferred);
115
+ if (maximumRank < 0) return null;
116
+ return (binding.allowed_reasoning_configurations || [])
117
+ .filter((candidate) => {
118
+ const rank = REVIEW_REASONING.indexOf(candidate);
119
+ return rank >= 0 && rank <= maximumRank;
120
+ })
121
+ .sort((left, right) => {
122
+ const leftRank = REVIEW_REASONING.indexOf(left);
123
+ const rightRank = REVIEW_REASONING.indexOf(right);
124
+ return Math.abs(leftRank - preferredRank) - Math.abs(rightRank - preferredRank)
125
+ || leftRank - rightRank;
126
+ })[0] || null;
127
+ }
128
+
129
+ /** Selects the one canonical reviewer from the signed selected-only capability projection. */
130
+ export function selectCanonicalReviewer({ installation, snapshot, builder_identity, clock = () => new Date() } = {}) {
131
+ assertObject(installation, 'INVALID_REVIEW_SELECTION', 'installation');
132
+ assertObject(snapshot, 'INVALID_REVIEW_SELECTION', 'snapshot');
133
+ const candidates = (installation.enabled_providers || []).flatMap((binding) =>
134
+ (binding.allowed_models || []).flatMap((modelId) => {
135
+ const model = snapshot.models?.find((candidate) =>
136
+ candidate.provider_id === binding.provider_id && candidate.model_id === modelId);
137
+ if (!model?.actions?.includes('review')) return [];
138
+ const reasoning = nearestReviewReasoning(binding, model);
139
+ if (!reasoning) return [];
140
+ const reviewer_identity = { provider_id: binding.provider_id, model_id: model.model_id };
141
+ return [{
142
+ binding, model, reasoning, reviewer_identity,
143
+ independence_level: computeIndependenceLevel({ builder_identity, reviewer_identity }),
144
+ }];
145
+ })
146
+ ).sort((left, right) =>
147
+ ({ A: 3, B: 2, C: 1 })[right.independence_level] - ({ A: 3, B: 2, C: 1 })[left.independence_level]
148
+ || (right.model.routing_priority?.['rail:review'] ?? right.model.routing_priority?.review ?? 0)
149
+ - (left.model.routing_priority?.['rail:review'] ?? left.model.routing_priority?.review ?? 0)
150
+ || (right.model.adjudication_priority ?? 0) - (left.model.adjudication_priority ?? 0)
151
+ || `${left.binding.harness_id}:${left.model.model_id}`.localeCompare(`${right.binding.harness_id}:${right.model.model_id}`)
152
+ );
153
+ const selected = candidates[0];
154
+ if (!selected) fail('NO_ELIGIBLE_REVIEWER', 'no eligible installed model exists for independent review');
155
+ const invocation = {
156
+ provider_id: selected.binding.provider_id,
157
+ harness_id: selected.binding.harness_id,
158
+ action: 'review',
159
+ model_pin: {
160
+ model_id: selected.model.model_id,
161
+ catalog_snapshot_ref: snapshot.snapshot_id,
162
+ reasoning_configuration: selected.reasoning,
163
+ },
164
+ };
165
+ assertEligibleInvocation({ installation, snapshot, invocation, clock });
166
+ return freeze({ ...invocation, independence_level: selected.independence_level });
167
+ }
168
+
106
169
  /** C-05: A/B may never silently degrade to C. */
107
170
  export function assertReviewIndependence(review) {
108
171
  const validated = validateReviewRecord(review);
@@ -7,6 +7,19 @@ snapshots. Delivery and reconciliation are distinct state dimensions. A caller
7
7
  may inject a fake transport in tests or an independently authorized ClickUp
8
8
  adapter at an outer boundary.
9
9
 
10
+ The installed `@chati/dev` router accepts remote acknowledgements and lookups
11
+ only after `.chati/v2/tracking/clickup-mcp-authority.json` contains a
12
+ project-bound authority certificate signed by the embedded CHATI Ed25519 root.
13
+ The certified MCP boundary then signs each result over the projection id,
14
+ ClickUp ref, idempotency key, operation, exact durable delivery attempt,
15
+ attempt timestamp and response digest. A receipt from an older send cannot
16
+ reconcile or reopen a newer uncertain attempt. Missing, expired,
17
+ foreign-project or self-signed certificates fail closed before reconciliation.
18
+ Only the certified factory can mint the verifier, and certificate validity is
19
+ rechecked for every receipt instead of only once at construction.
20
+ Public acknowledgement and lookup APIs load that project authority internally;
21
+ they expose no verifier parameter that caller code can replace.
22
+
10
23
  ## Guarantees
11
24
 
12
25
  - A projection is persisted before `transport.send()` can run.