harness-everything 0.11.7 → 0.12.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 (68) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +32 -0
  4. package/behavioral-evals/README.md +37 -0
  5. package/behavioral-evals/cases/self-evolve-retrieval-recurrence.yaml +48 -0
  6. package/behavioral-evals/paired-benchmark.js +211 -5
  7. package/ci/contract-integrity.test.js +68 -2
  8. package/ci/mechanism-2ah-workflow-lifecycle.test.js +137 -0
  9. package/ci/mechanism-32-paired-benchmark.test.js +139 -0
  10. package/ci/openai-plugin-package.test.js +17 -0
  11. package/ci/self-evolve-loop.test.js +37 -2
  12. package/ci/telemetry.test.js +31 -1
  13. package/grill-with-docs/ADR-FORMAT.md +22 -0
  14. package/grill-with-docs/SKILL.md +1 -1
  15. package/hooks/scripts/lib/learning-opportunity.js +22 -0
  16. package/hooks/scripts/lib/telemetry.js +40 -0
  17. package/hooks/scripts/lib/workflow-runtime.js +18 -1
  18. package/hooks/scripts/state-persist.js +5 -1
  19. package/hooks/scripts/workflow-disposition.js +19 -8
  20. package/hooks/scripts/workflow-gate.js +16 -3
  21. package/multi-agent-workspace/SKILL.md +1 -1
  22. package/multi-agent-workspace/scripts/index_memory.js +28 -0
  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/contract-integrity/scripts/audit.js +536 -0
  27. package/plugins/harness-everything/hooks/scripts/lib/learning-opportunity.js +22 -0
  28. package/plugins/harness-everything/hooks/scripts/lib/telemetry.js +40 -0
  29. package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +18 -1
  30. package/plugins/harness-everything/hooks/scripts/state-persist.js +5 -1
  31. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +19 -8
  32. package/plugins/harness-everything/hooks/scripts/workflow-gate.js +16 -3
  33. package/plugins/harness-everything/plugin.json +1 -1
  34. package/plugins/harness-everything/skills/grill-with-docs/ADR-FORMAT.md +22 -0
  35. package/plugins/harness-everything/skills/grill-with-docs/SKILL.md +1 -1
  36. package/plugins/harness-everything/skills/multi-agent-workspace/SKILL.md +1 -1
  37. package/plugins/harness-everything/skills/multi-agent-workspace/scripts/index_memory.js +28 -0
  38. package/plugins/harness-everything/skills/self-evolve/SKILL.md +1 -1
  39. package/plugins/harness-everything/skills/self-evolve/scripts/lesson-candidate.js +52 -0
  40. package/plugins/harness-everything/skills/to-spec/SKILL.md +1 -1
  41. package/plugins/harness-everything/skills/to-spec/references/process.md +26 -0
  42. package/plugins/harness-everything/skills/to-spec/templates/cli-reference.md +14 -0
  43. package/plugins/harness-everything/skills/to-spec/templates/dev-doc.md +14 -0
  44. package/plugins/harness-everything/skills/to-spec/templates/feature-spec.md +14 -0
  45. package/plugins/harness-everything/skills/to-spec/templates/schema-doc.md +14 -0
  46. package/plugins/harness-everything/skills/to-tickets/SKILL.md +1 -1
  47. package/plugins/harness-everything/skills/to-tickets/references/publishing-and-templates.md +20 -1
  48. package/plugins/harness-everything/skills/verification-loop/SKILL.md +3 -2
  49. package/plugins/harness-everything/skills/verification-loop/references/verification-phases.md +25 -1
  50. package/plugins/harness-everything/skills/verification-loop/scripts/contract-integrity-audit.js +31 -0
  51. package/plugins/harness-everything/skills/verification-loop/templates/verification-report.template.md +3 -0
  52. package/scripts/sync-openai-plugin.js +12 -0
  53. package/self-evolve/SKILL.md +1 -1
  54. package/self-evolve/scripts/lesson-candidate.js +52 -0
  55. package/telemetry/schemas/event.schema.json +141 -22
  56. package/telemetry/scripts/report.js +42 -0
  57. package/to-spec/SKILL.md +1 -1
  58. package/to-spec/references/process.md +26 -0
  59. package/to-spec/templates/cli-reference.md +14 -0
  60. package/to-spec/templates/dev-doc.md +14 -0
  61. package/to-spec/templates/feature-spec.md +14 -0
  62. package/to-spec/templates/schema-doc.md +14 -0
  63. package/to-tickets/SKILL.md +1 -1
  64. package/to-tickets/references/publishing-and-templates.md +20 -1
  65. package/verification-loop/SKILL.md +3 -2
  66. package/verification-loop/references/verification-phases.md +25 -1
  67. package/verification-loop/scripts/contract-integrity-audit.js +31 -0
  68. package/verification-loop/templates/verification-report.template.md +3 -0
@@ -3,7 +3,7 @@
3
3
 
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
- const { loadWorkflow, saveWorkflow, matchingRun, OPEN_STATES, ensureWorkflowBudget, recordBudgetEvent, resetWorkflowBudget, syncBudgetToRun, WORKFLOW_CONTROLLER_COMMANDS } = require('./lib/workflow-runtime');
6
+ const { loadWorkflow, saveWorkflow, matchingRun, OPEN_STATES, budgetLimits, ensureWorkflowBudget, recordBudgetEvent, resetWorkflowBudget, syncBudgetToRun, WORKFLOW_CONTROLLER_COMMANDS } = require('./lib/workflow-runtime');
7
7
  const { getWorkspaceRoot, readCurrentSession } = require('./lib/harness-state');
8
8
  const { atomicWriteJson, readJson } = require('./lib/fable-contracts');
9
9
 
@@ -32,6 +32,20 @@ function consumer() {
32
32
  throw new Error('Fable consumer unavailable');
33
33
  }
34
34
 
35
+ function activatePlan(workflow, plan) {
36
+ workflow.workflowPlan = plan;
37
+ workflow.strategy = plan.strategy;
38
+ workflow.strategySelection = plan.strategySelection;
39
+ workflow.tier = plan.tier;
40
+ workflow.requiredInvariants = plan.requiredInvariants || [];
41
+ workflow.suggestedSkills = plan.suggestedSkills || [];
42
+ workflow.verification = plan.verification;
43
+ workflow.mutationIsolation = plan.mutationIsolation || { required: false };
44
+ const budget = ensureWorkflowBudget(workflow);
45
+ budget.limits = budgetLimits(workflow);
46
+ budget.updatedAt = new Date().toISOString();
47
+ }
48
+
35
49
  function main() {
36
50
  const args = parseArgs(process.argv.slice(2));
37
51
  if (!WORKFLOW_CONTROLLER_COMMANDS.has(args.command)) throw new Error(usage());
@@ -47,10 +61,12 @@ function main() {
47
61
  if (isReplan) recordBudgetEvent(context, 'replan', { evidence: 'workflow-disposition:start' });
48
62
  const plan = workflow.pendingPlan || workflow.workflowPlan;
49
63
  if (!String(plan.strategy || '').startsWith('fable-')) {
64
+ activatePlan(workflow, plan);
50
65
  workflow.revision++;
51
66
  workflow.state = 'running';
67
+ workflow.escapes = [];
68
+ delete workflow.pendingPlan;
52
69
  delete workflow.blockReason;
53
- ensureWorkflowBudget(workflow);
54
70
  saveWorkflow(context);
55
71
  process.stdout.write(JSON.stringify({ state: workflow.state, workflowId: workflow.workflowId, revision: workflow.revision }) + '\n');
56
72
  return;
@@ -66,18 +82,13 @@ function main() {
66
82
  routerContract: { workflowPlan: plan }, stages, workspaceRoot: context.root,
67
83
  sessionId, workflowId: workflow.workflowId,
68
84
  });
69
- workflow.workflowPlan = plan;
70
- workflow.strategy = plan.strategy;
71
- workflow.tier = plan.tier;
72
- workflow.verification = plan.verification;
73
- workflow.mutationIsolation = plan.mutationIsolation || workflow.mutationIsolation;
85
+ activatePlan(workflow, plan);
74
86
  workflow.runId = run.runId;
75
87
  workflow.revision++;
76
88
  workflow.state = 'running';
77
89
  workflow.escapes = [];
78
90
  delete workflow.pendingPlan;
79
91
  delete workflow.blockReason;
80
- ensureWorkflowBudget(workflow);
81
92
  } else if (args.command === 'revision') {
82
93
  recordBudgetEvent(context, 'revision', { evidence: args.evidence || 'workflow-disposition:revision' });
83
94
  } else if (args.command === 'reset-budget') {
@@ -62,9 +62,22 @@ function decide(payload) {
62
62
 
63
63
  // Shell safety and shell mutation accounting are intentionally separate.
64
64
  // `untrusted` means "not proven read-only", not "a mutation occurred".
65
- // Capture an opaque pre-execution workspace fingerprint; the post-tool
66
- // observer consumes an iteration only when workspace content actually changed.
67
- const fingerprint = workspaceFingerprint(cwd);
65
+ // Capture an opaque pre-execution workspace fingerprint when possible. A
66
+ // non-major workflow may run outside Git, where mutation observation is an
67
+ // accounting aid rather than an isolation boundary; degrade conservatively
68
+ // instead of blocking the user's command (#162).
69
+ let fingerprint;
70
+ try {
71
+ fingerprint = workspaceFingerprint(cwd);
72
+ } catch (error) {
73
+ if (isMajorWorkflow(workflow)) throw error;
74
+ if (workflow.strategy === 'iterative-single') {
75
+ recordBudgetEvent(context, 'iteration', { evidence: 'shell:unobservable-workspace' });
76
+ }
77
+ workflow.lastMutationAt = Date.now();
78
+ saveWorkflow(context);
79
+ return;
80
+ }
68
81
  const probeKey = shellProbeKey(payload, cwd);
69
82
  registerMutationProbe(context, probeKey, fingerprint, workflow.strategy === 'iterative-single');
70
83
  }
@@ -4,7 +4,7 @@ description: "Scaffold a verified multi-agent workspace and select bounded speci
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: Miya Daniel
7
- version: 0.10.0
7
+ version: 0.12.0
8
8
  ---
9
9
 
10
10
  # Multi-Agent Workspace
@@ -5,6 +5,18 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
  const { getWorkspaceRoot, getRuntimeRoot, resolveProjectDocs } = require('./project-docs-resolver');
7
7
 
8
+ let emitLessonTelemetry = () => ({ ok: false, unavailable: true });
9
+ for (const relative of [
10
+ '../../hooks/scripts/lib/telemetry.js',
11
+ '../../../hooks/scripts/lib/telemetry.js',
12
+ ]) {
13
+ const candidate = path.resolve(__dirname, relative);
14
+ if (fs.existsSync(candidate)) {
15
+ ({ emitLessonTelemetry } = require(candidate));
16
+ break;
17
+ }
18
+ }
19
+
8
20
  function option(args, ...names) {
9
21
  for (const name of names) {
10
22
  const index = args.indexOf(name);
@@ -166,6 +178,22 @@ function retrieveMemoryRecords({ workspace, task = '', requirement = '', role =
166
178
  });
167
179
  }
168
180
 
181
+ for (const record of included) {
182
+ if (!record.origin?.lessonCandidateId) continue;
183
+ emitLessonTelemetry({
184
+ event: 'lesson_retrieved',
185
+ root,
186
+ sessionId: record.writer?.sessionId || null,
187
+ candidateId: record.origin.lessonCandidateId,
188
+ observedAt: new Date(nowMs).toISOString(),
189
+ status: 'success',
190
+ reasonCodes: [
191
+ 'scoped-memory-retrieval',
192
+ ...(record.retrieval?.reasonCodes || []),
193
+ ],
194
+ });
195
+ }
196
+
169
197
  return {
170
198
  schemaVersion: 1,
171
199
  workspace: root,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "harness-enforcement",
3
3
  "description": "Repository inventory for the opencode enforcement plugin and its standalone helper",
4
- "version": "0.11.7",
4
+ "version": "0.12.0",
5
5
  "runtime": "index.mjs",
6
6
  "hooks": {
7
7
  "verify": "hooks/verify.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness-everything",
3
- "version": "0.11.7",
3
+ "version": "0.12.0",
4
4
  "description": "Harness OS: An Orchestrated Agent Operating System for AI-driven Development",
5
5
  "main": "harness-everything/scripts/bootstrap.js",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness-everything",
3
- "version": "0.11.7",
3
+ "version": "0.12.0",
4
4
  "description": "Invariant-first engineering harness for routing, verification, and failure recovery while preserving agent autonomy.",
5
5
  "author": {
6
6
  "name": "Miya Daniel",