harness-everything 0.16.6 → 0.18.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 (37) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/AGENTS.md +2 -1
  4. package/CHANGELOG.md +34 -0
  5. package/README.md +1 -0
  6. package/behavioral-evals/cases/pressure-status-visibility.yaml +30 -0
  7. package/ci/invariant-routing.test.js +13 -0
  8. package/ci/mechanism-2ai-workspace-fingerprint-batch.test.js +11 -1
  9. package/ci/mechanism-2an-workflow-obligations.test.js +201 -0
  10. package/ci/router-workflow-plan.test.js +3 -0
  11. package/docs/architecture.md +18 -1
  12. package/docs/routing.md +21 -2
  13. package/docs/workflow-runtime.md +15 -0
  14. package/harness-everything/SKILL.md +4 -3
  15. package/harness-everything/references/triage-and-tiers.md +21 -4
  16. package/harness-everything/scripts/kernel-router-core.js +12 -0
  17. package/harness-everything/scripts/kernel-router.js +14 -3
  18. package/harness-everything/scripts/router-contract-core.js +1 -1
  19. package/hooks/scripts/lib/workflow-obligations.js +316 -0
  20. package/hooks/scripts/lib/workflow-runtime.js +1 -1
  21. package/hooks/scripts/workflow-disposition.js +97 -5
  22. package/hooks/scripts/workflow-stop-gate.js +12 -4
  23. package/opencode-plugin/plugin.json +1 -1
  24. package/package.json +1 -1
  25. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  26. package/plugins/harness-everything/hooks/scripts/lib/workflow-obligations.js +316 -0
  27. package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +1 -1
  28. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +97 -5
  29. package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +12 -4
  30. package/plugins/harness-everything/plugin.json +1 -1
  31. package/plugins/harness-everything/scripts/lib/advisory-text.js +12 -2
  32. package/plugins/harness-everything/skills/harness-everything/SKILL.md +4 -3
  33. package/plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md +21 -4
  34. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js +12 -0
  35. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +14 -3
  36. package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js +1 -1
  37. package/scripts/lib/advisory-text.js +12 -2
@@ -24,6 +24,7 @@ const { applyEnsemblePolicy } = require('./ensemble-policy');
24
24
  const INVARIANT_TEXT = {
25
25
  'scope-lock': 'Route before execution: stay inside the authorized task/repository scope.',
26
26
  'verify-before-claim': 'Verify before claim: completion claims require objective evidence appropriate to the change.',
27
+ 'visible-status-updates': 'User-visible status is mandatory: use the single Harness Status format with Current, Read/Evidence, and Next at required phase boundaries; add Blocked/Risk only when materially applicable.',
27
28
  'replan-after-repeated-failure': 'Re-plan on repetition: after 3 same-signature failures, stop micro-retrying and zoom out/re-diagnose.',
28
29
  'evaluate-suggestions-before-skip': 'Evaluate before skip: read each suggested skill\'s complete SKILL.md entry/basic flow before omitting it.',
29
30
  'loop-awareness': 'When iterative work runs long, remind the agent to verify assumptions or re-plan; never hard-stop on a count.',
@@ -153,6 +154,7 @@ function printRoutingCheckpoint(plan) {
153
154
  console.log(` - Strategy: ${plan.strategy || 'deferred'}`);
154
155
  console.log(` - Required invariants: ${invariants.length ? invariants.join(', ') : 'none'}`);
155
156
  console.log(` - Suggested skills: ${suggestions.length ? suggestions.join(', ') : 'none'}`);
157
+ console.log(' - User-visible progress: use this checkpoint as source state for the single Harness Status contract below; do not invent a per-skill progress format.');
156
158
  if (suggestions.length > 0) {
157
159
  console.log(' - Suggestion evaluation: MANDATORY. Before skipping any listed skill, read its complete SKILL.md entry and evaluate USE FOR, DO NOT USE FOR, workflow/basic flow, and hard rules.');
158
160
  console.log(' - Skip evidence: do not reject from only the skill name, description, router summary, or a generic "routine/common task" judgement. If the entry cannot be resolved/read, mark it unresolved/unavailable rather than skipped.');
@@ -166,6 +168,16 @@ function printKernelContract(plan) {
166
168
  console.log(` - ${invariant}: ${INVARIANT_TEXT[invariant] || 'Required by the selected workflow plan.'}`);
167
169
  }
168
170
 
171
+ console.log('\n=> USER-VISIBLE HARNESS STATUS CONTRACT (MUST):');
172
+ console.log(' - For non-trivial software/project work, the agent MUST use one compact user-visible status format:');
173
+ console.log(' Harness Status');
174
+ console.log(' - Current: <what is being done now>');
175
+ console.log(' - Read/Evidence: <important files/sources/evidence read or confirmed>');
176
+ console.log(' - Next: <next intended action>');
177
+ console.log(' - Blocked/Risk: <only when materially applicable>');
178
+ console.log(' - Emit it before substantive execution, after a major phase, when direction materially changes, at meaningful long-running phase boundaries, and before final completion (the final response may merge it naturally).');
179
+ console.log(' - This is a semantic communication MUST, not a hard execution lock, counter, or reset condition.');
180
+
169
181
  console.log('\n=> WORKFLOW SKILLS (EVALUATE APPLICABILITY — SELECTED WORKFLOW IS GUIDANCE):');
170
182
  if (Array.isArray(plan.suggestedSkills) && plan.suggestedSkills.length > 0) {
171
183
  const emitted = new Set();
@@ -44,7 +44,8 @@ function isHostNotificationPrompt(prompt) {
44
44
  return /^<task-notification[\s>][\s\S]*<\/task-notification>\s*$/i.test(text);
45
45
  }
46
46
 
47
- function persistWorkflow(plan, payload, prompt) {
47
+ function persistWorkflow(contract, payload, prompt) {
48
+ const plan = contract && contract.workflowPlan;
48
49
  if (!payload || !(payload.session_id || payload.sessionId)) return null;
49
50
  const { runtime, hooksRoot } = loadRuntime();
50
51
  const context = runtime.loadWorkflow(payload);
@@ -83,6 +84,7 @@ function persistWorkflow(plan, payload, prompt) {
83
84
  verification: plan.verification,
84
85
  mutationIsolation: plan.mutationIsolation || { required: false },
85
86
  workflowPlan: plan,
87
+ taskShape: contract.taskShape || null,
86
88
  state: selected ? 'pending' : 'deferred',
87
89
  planningWarnings: plan.fallback?.disposition === 'none' ? [] : [...(plan.fallback?.reasonCodes || [])],
88
90
  runId: null,
@@ -94,6 +96,10 @@ function persistWorkflow(plan, payload, prompt) {
94
96
  hardBoundaries: ['rule-of-3-reflection', 'user-host-permission'],
95
97
  },
96
98
  };
99
+ if (selected && ['tier2', 'tier3'].includes(plan.tier)) {
100
+ const { initializePlanningContract } = require(path.join(hooksRoot, 'lib/workflow-obligations'));
101
+ initializePlanningContract(context, plan);
102
+ }
97
103
  const memoryCapability = issueMemoryCapability(context.workflow);
98
104
  runtime.saveWorkflow(context);
99
105
  return { ...context, hooksRoot, retained: false, memoryCapability };
@@ -115,7 +121,7 @@ function run(raw) {
115
121
  let persisted = null;
116
122
  let failure = null;
117
123
  try {
118
- persisted = persistWorkflow(plan, payload, prompt);
124
+ persisted = persistWorkflow(result?.contract || null, payload, prompt);
119
125
  if (persisted?.retained && persisted.workflow) plan = persisted.workflow.workflowPlan;
120
126
  } catch (error) { failure = error; }
121
127
  if (hostNotification && !persisted?.workflow) {
@@ -146,7 +152,12 @@ function run(raw) {
146
152
  console.log(' - Memory write disposition: ' + (persisted.workflow.workflowPlan.memory?.write || 'none'));
147
153
  if (persisted.memoryCapability) console.log(' - Memory capability (single-use, workflow/session-bound): ' + persisted.memoryCapability);
148
154
  console.log(' - Stage specification: ' + path.join(persisted.sessionDir, 'workflow-stages.json'));
149
- console.log(' - Enter/replan: node "' + controller + '" start --session-id "' + persisted.sessionId + '"');
155
+ if (plan.strategySelection === 'selected' && ['tier2', 'tier3'].includes(plan.tier)) {
156
+ console.log(' - Planning contract: ' + path.join(persisted.sessionDir, 'workflow-obligations.json'));
157
+ console.log(' - Requirements first: decompose intent into requirement fragments, then confirm the smallest sufficient workflow.');
158
+ console.log(' - Record plan: node "' + controller + '" plan --session-id "' + persisted.sessionId + '" --requirements-json "[{\\\"id\\\":\\\"req-1\\\",\\\"summary\\\":\\\"...\\\",\\\"acceptance\\\":\\\"...\\\"}]" --strategy "' + plan.strategy + '" --evidence "<why this workflow fits>"');
159
+ }
160
+ console.log(' - Enter selected workflow after planning: node "' + controller + '" start --session-id "' + persisted.sessionId + '"');
150
161
  console.log(' - Escape one declared stage: node "' + controller + '" escape --session-id "' + persisted.sessionId + '" --stage-id "<id>" --reason-code workflow-uncovered-scope --scope "<uncovered scope>" --evidence "<evidence>"');
151
162
  } else {
152
163
  console.log(' - Runtime state was not persisted; reminders may be less precise, but execution remains available.');
@@ -320,7 +320,7 @@ function selectWorkflowStrategy(input = {}) {
320
320
  function planMetadataForStrategy(strategy) {
321
321
  const base = {
322
322
  patterns: ['router'],
323
- requiredInvariants: ['scope-lock', 'verify-before-claim', 'replan-after-repeated-failure'],
323
+ requiredInvariants: ['scope-lock', 'verify-before-claim', 'replan-after-repeated-failure', 'visible-status-updates'],
324
324
  suggestedSkills: [],
325
325
  maxIterations: null,
326
326
  parallelAllowed: null,
@@ -15,7 +15,16 @@ const advisoryInstructions = [
15
15
  `2. For EVERY suggested skill, read its complete \`SKILL.md\` entry and evaluate applicability from \`USE FOR\`, \`DO NOT USE FOR\`, and its basic flow.`,
16
16
  `3. Treat the selected workflow topology and numeric limits as planning guidance, not a lock. Choose, combine, reorder, or skip steps when evidence supports it.`,
17
17
  `4. Prefer objective verification before declaring done and worktree isolation for broad/Tier-3 mutation.`,
18
- `5. Surface a compact routing checkpoint with tier, strategy, suggested skills, and any relevant warnings.`,
18
+ `5. Use the routing checkpoint as source state for the first Harness Status; do not expose a competing progress format.`,
19
+ ``,
20
+ `## 📣 USER-VISIBLE STATUS (MUST)`,
21
+ `For non-trivial software/project work, this semantic communication contract is mandatory even when the host integration itself is instruction-only:`,
22
+ `- \`Harness Status\``,
23
+ `- \`Current:\` what is being done now`,
24
+ `- \`Read/Evidence:\` important files, sources, or evidence read/confirmed`,
25
+ `- \`Next:\` the next intended action`,
26
+ `- \`Blocked/Risk:\` only when materially applicable`,
27
+ `Emit it before substantive execution, after a major phase, when direction materially changes, at meaningful long-running phase boundaries, and before final completion. This MUST does not imply a hard runtime lock.`,
19
28
  ``,
20
29
  `## 🤖 COGNITIVE COMPLIANCE`,
21
30
  `- **No universal skill pipeline**: do not force every task through TODO/TDD/Fable.`,
@@ -135,7 +144,8 @@ function buildCodexGlobalContent() {
135
144
  `This instruction surface cannot be assumed to provide hard lifecycle blocking.`,
136
145
  ``,
137
146
  `- Discover the environment and host capabilities before relying on them.`,
138
- `- For software/project work, run \`npx github:dyphn1/Harness-everything next "<summary>"\` before mutation and surface the routing checkpoint.`,
147
+ `- For software/project work, run \`npx github:dyphn1/Harness-everything next "<summary>"\` before mutation and use the routing checkpoint as source state for the first Harness Status.`,
148
+ `- For non-trivial work, MUST keep the user informed with one Harness Status shape: Current, Read/Evidence, Next, plus Blocked/Risk only when material; repeat it at major phase/direction boundaries and before final completion.`,
139
149
  `- Read every suggested skill's complete \`SKILL.md\` entry before resolving applicability; do not omit it from metadata or confidence alone.`,
140
150
  `- Use the selected workflow topology as planning guidance; the model may adapt or skip steps with an explicit evidence-based reason.`,
141
151
  `- Do not impose a universal TODO/TDD/Fable sequence; use the smallest useful topology plus applicable skills.`,