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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +32 -0
- package/behavioral-evals/README.md +37 -0
- package/behavioral-evals/cases/self-evolve-retrieval-recurrence.yaml +48 -0
- package/behavioral-evals/paired-benchmark.js +211 -5
- package/ci/contract-integrity.test.js +68 -2
- package/ci/mechanism-2ah-workflow-lifecycle.test.js +137 -0
- package/ci/mechanism-32-paired-benchmark.test.js +139 -0
- package/ci/openai-plugin-package.test.js +17 -0
- package/ci/self-evolve-loop.test.js +37 -2
- package/ci/telemetry.test.js +31 -1
- package/grill-with-docs/ADR-FORMAT.md +22 -0
- package/grill-with-docs/SKILL.md +1 -1
- package/hooks/scripts/lib/learning-opportunity.js +22 -0
- package/hooks/scripts/lib/telemetry.js +40 -0
- package/hooks/scripts/lib/workflow-runtime.js +18 -1
- package/hooks/scripts/state-persist.js +5 -1
- package/hooks/scripts/workflow-disposition.js +19 -8
- package/hooks/scripts/workflow-gate.js +16 -3
- package/multi-agent-workspace/SKILL.md +1 -1
- package/multi-agent-workspace/scripts/index_memory.js +28 -0
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/contract-integrity/scripts/audit.js +536 -0
- package/plugins/harness-everything/hooks/scripts/lib/learning-opportunity.js +22 -0
- package/plugins/harness-everything/hooks/scripts/lib/telemetry.js +40 -0
- package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +18 -1
- package/plugins/harness-everything/hooks/scripts/state-persist.js +5 -1
- package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +19 -8
- package/plugins/harness-everything/hooks/scripts/workflow-gate.js +16 -3
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/skills/grill-with-docs/ADR-FORMAT.md +22 -0
- package/plugins/harness-everything/skills/grill-with-docs/SKILL.md +1 -1
- package/plugins/harness-everything/skills/multi-agent-workspace/SKILL.md +1 -1
- package/plugins/harness-everything/skills/multi-agent-workspace/scripts/index_memory.js +28 -0
- package/plugins/harness-everything/skills/self-evolve/SKILL.md +1 -1
- package/plugins/harness-everything/skills/self-evolve/scripts/lesson-candidate.js +52 -0
- package/plugins/harness-everything/skills/to-spec/SKILL.md +1 -1
- package/plugins/harness-everything/skills/to-spec/references/process.md +26 -0
- package/plugins/harness-everything/skills/to-spec/templates/cli-reference.md +14 -0
- package/plugins/harness-everything/skills/to-spec/templates/dev-doc.md +14 -0
- package/plugins/harness-everything/skills/to-spec/templates/feature-spec.md +14 -0
- package/plugins/harness-everything/skills/to-spec/templates/schema-doc.md +14 -0
- package/plugins/harness-everything/skills/to-tickets/SKILL.md +1 -1
- package/plugins/harness-everything/skills/to-tickets/references/publishing-and-templates.md +20 -1
- package/plugins/harness-everything/skills/verification-loop/SKILL.md +3 -2
- package/plugins/harness-everything/skills/verification-loop/references/verification-phases.md +25 -1
- package/plugins/harness-everything/skills/verification-loop/scripts/contract-integrity-audit.js +31 -0
- package/plugins/harness-everything/skills/verification-loop/templates/verification-report.template.md +3 -0
- package/scripts/sync-openai-plugin.js +12 -0
- package/self-evolve/SKILL.md +1 -1
- package/self-evolve/scripts/lesson-candidate.js +52 -0
- package/telemetry/schemas/event.schema.json +141 -22
- package/telemetry/scripts/report.js +42 -0
- package/to-spec/SKILL.md +1 -1
- package/to-spec/references/process.md +26 -0
- package/to-spec/templates/cli-reference.md +14 -0
- package/to-spec/templates/dev-doc.md +14 -0
- package/to-spec/templates/feature-spec.md +14 -0
- package/to-spec/templates/schema-doc.md +14 -0
- package/to-tickets/SKILL.md +1 -1
- package/to-tickets/references/publishing-and-templates.md +20 -1
- package/verification-loop/SKILL.md +3 -2
- package/verification-loop/references/verification-phases.md +25 -1
- package/verification-loop/scripts/contract-integrity-audit.js +31 -0
- 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
|
|
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
|
|
66
|
-
//
|
|
67
|
-
|
|
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
|
}
|
|
@@ -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,
|
package/package.json
CHANGED