project-tiny-context-harness 0.2.81 → 0.2.82
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/README.md +3 -1
- package/assets/README.md +3 -1
- package/assets/README.zh-CN.md +2 -0
- package/assets/skills/composite-long-task-workflow/SKILL.md +3 -1
- package/assets/skills/composite-long-task-workflow/assets/goal-objective.template.md +2 -2
- package/assets/skills/composite-long-task-workflow/references/composite-long-task-workflow-protocol.md +7 -2
- package/dist/lib/superpowers-task-assertion-normalizers.js +4 -1
- package/dist/lib/superpowers-task-assertions.js +17 -16
- package/dist/lib/superpowers-task-delivery.js +30 -18
- package/dist/lib/superpowers-task-derive.d.ts +1 -0
- package/dist/lib/superpowers-task-derive.js +62 -1
- package/dist/lib/superpowers-task-fields.d.ts +22 -0
- package/dist/lib/superpowers-task-fields.js +276 -0
- package/dist/lib/superpowers-task-source-compile.js +93 -95
- package/dist/lib/superpowers-task-source-parser.js +1 -3
- package/dist/lib/superpowers-task-state-schema.d.ts +59 -0
- package/dist/lib/superpowers-task-state.js +14 -5
- package/dist/lib/superpowers-task-validator.js +6 -10
- package/package.json +69 -69
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { ensureDir, pathExists, readText, writeTextIfChanged } from "./fs.js";
|
|
4
|
+
import { normalizeProofLayerId } from "./superpowers-task-fields.js";
|
|
4
5
|
import { appendSuperpowersEvent } from "./superpowers-task-events.js";
|
|
5
6
|
import { evaluateProofLayerAssertions, isMachineVerifiableLayer, normalizeAssertionResult, normalizeNegativeEvidenceScan } from "./superpowers-task-assertions.js";
|
|
6
7
|
import { SUPERPOWERS_TASK_STATE_JSON_SCHEMA, SUPERPOWERS_TASK_STATE_SCHEMA_VERSION, asStringArray, isRecord } from "./superpowers-task-state-schema.js";
|
|
@@ -54,7 +55,15 @@ export async function initializeSuperpowersTask(workdir, options = {}) {
|
|
|
54
55
|
full_population_required: null,
|
|
55
56
|
representative_samples_validate: [],
|
|
56
57
|
representative_samples_do_not_validate: [],
|
|
57
|
-
out_of_scope_backlog: []
|
|
58
|
+
out_of_scope_backlog: [],
|
|
59
|
+
scope_fit_decision: "",
|
|
60
|
+
selected_scope_fit_slice: "",
|
|
61
|
+
owner_boundary: "",
|
|
62
|
+
primary_capability_path: "",
|
|
63
|
+
non_completing_outcomes: [],
|
|
64
|
+
assertion_policy: "",
|
|
65
|
+
source_authority: "",
|
|
66
|
+
product_goal: ""
|
|
58
67
|
},
|
|
59
68
|
scope_conflicts: []
|
|
60
69
|
},
|
|
@@ -121,8 +130,8 @@ export async function applySliceDelta(workdir, deltaFile) {
|
|
|
121
130
|
missing_layer_classes: asStringArray(delta.missing_layer_classes),
|
|
122
131
|
code_changes: asStringArray(delta.code_changes),
|
|
123
132
|
evidence_records: evidenceRecords.map((item) => item.evidence_id),
|
|
124
|
-
closed_layers: asStringArray(delta.closed_layers),
|
|
125
|
-
remaining_layers: asStringArray(delta.remaining_layers),
|
|
133
|
+
closed_layers: asStringArray(delta.closed_layers).map(normalizeProofLayerId),
|
|
134
|
+
remaining_layers: asStringArray(delta.remaining_layers).map(normalizeProofLayerId),
|
|
126
135
|
blockers: Array.isArray(delta.blockers) ? delta.blockers : [],
|
|
127
136
|
cleanup_assertions: asStringArray(delta.cleanup_assertions),
|
|
128
137
|
progress_value: {
|
|
@@ -223,8 +232,8 @@ function readEvidenceRecords(value) {
|
|
|
223
232
|
command: item.command === undefined ? undefined : String(item.command),
|
|
224
233
|
command_exit_code: item.command_exit_code === undefined ? undefined : Number(item.command_exit_code),
|
|
225
234
|
artifact_paths: asStringArray(item.artifact_paths),
|
|
226
|
-
proves: asStringArray(item.proves),
|
|
227
|
-
does_not_prove: asStringArray(item.does_not_prove),
|
|
235
|
+
proves: asStringArray(item.proves).map(normalizeProofLayerId),
|
|
236
|
+
does_not_prove: asStringArray(item.does_not_prove).map((value) => (value.includes(".") ? normalizeProofLayerId(value) : value)),
|
|
228
237
|
redaction: isRecord(item.redaction)
|
|
229
238
|
? { checked: item.redaction.checked === true, contains_secret: item.redaction.contains_secret === true }
|
|
230
239
|
: { checked: false, contains_secret: false },
|
|
@@ -8,7 +8,7 @@ import { fullPopulationRequired, validateDeliveryContract, validateScopeConflict
|
|
|
8
8
|
import { loadSuperpowersState, sha256 } from "./superpowers-task-state.js";
|
|
9
9
|
import { validateCanonicalStatuses } from "./superpowers-task-status.js";
|
|
10
10
|
import { isRecord } from "./superpowers-task-state-schema.js";
|
|
11
|
-
import { evaluateProofLayerAssertions, isUiBrowserLayer } from "./superpowers-task-assertions.js";
|
|
11
|
+
import { evaluateProofLayerAssertions, isUiBrowserLayer, proofLayerName } from "./superpowers-task-assertions.js";
|
|
12
12
|
export async function validateSuperpowersState(projectRoot, args = []) {
|
|
13
13
|
const info = [];
|
|
14
14
|
const warnings = [];
|
|
@@ -24,12 +24,7 @@ export async function validateSuperpowersState(projectRoot, args = []) {
|
|
|
24
24
|
state = await loadSuperpowersState(targetDir);
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
27
|
-
return {
|
|
28
|
-
info,
|
|
29
|
-
warnings,
|
|
30
|
-
hygiene,
|
|
31
|
-
errors: [`${repoRelative(projectRoot, statePath)} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`]
|
|
32
|
-
};
|
|
27
|
+
return { info, warnings, hygiene, errors: [`${repoRelative(projectRoot, statePath)} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`] };
|
|
33
28
|
}
|
|
34
29
|
validateShape(state, errors);
|
|
35
30
|
if (!hasUsableShape(state)) {
|
|
@@ -165,10 +160,11 @@ function validateEvidenceRecords(state, errors) {
|
|
|
165
160
|
errors.push(`${label} uses sibling substitution without approval`);
|
|
166
161
|
}
|
|
167
162
|
for (const proofLayer of evidence.proves ?? []) {
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
const layerName = proofLayerName(proofLayer);
|
|
164
|
+
if (layerName === "worker_runtime" && /\b(mock|unit|viewmodel)\b/i.test(evidence.type)) {
|
|
165
|
+
errors.push(`${label} worker_runtime proof cannot be mock/unit/viewmodel only`);
|
|
170
166
|
}
|
|
171
|
-
if (
|
|
167
|
+
if (layerName === "ui_browser" && !/(browser|ui_browser|screenshot|playwright)/i.test(evidence.type)) {
|
|
172
168
|
errors.push(`${label} UI proof must use browser owner surface evidence`);
|
|
173
169
|
}
|
|
174
170
|
}
|
package/package.json
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "project-tiny-context-harness",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Minimal project memory and validation harness for AI coding agents.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Seven128",
|
|
7
|
-
"homepage": "https://github.com/Seven128/project-tiny-context-harness#readme",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/Seven128/project-tiny-context-harness.git",
|
|
11
|
-
"directory": "packages/ty-context"
|
|
12
|
-
},
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/Seven128/project-tiny-context-harness/issues"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [
|
|
17
|
-
"ai-agents",
|
|
18
|
-
"coding-agent",
|
|
19
|
-
"codex",
|
|
20
|
-
"claude-code",
|
|
21
|
-
"cursor",
|
|
22
|
-
"gemini-cli",
|
|
23
|
-
"opencode",
|
|
24
|
-
"agent-context",
|
|
25
|
-
"context-engineering",
|
|
26
|
-
"context-management",
|
|
27
|
-
"agents-md",
|
|
28
|
-
"project-memory",
|
|
29
|
-
"agent-memory",
|
|
30
|
-
"ai-coding",
|
|
31
|
-
"multi-agent",
|
|
32
|
-
"llm",
|
|
33
|
-
"developer-tools",
|
|
34
|
-
"developer-productivity",
|
|
35
|
-
"cli",
|
|
36
|
-
"ty-context",
|
|
37
|
-
"workflow"
|
|
38
|
-
],
|
|
39
|
-
"type": "module",
|
|
40
|
-
"bin": {
|
|
41
|
-
"ty-context": "dist/cli.js"
|
|
42
|
-
},
|
|
43
|
-
"files": [
|
|
44
|
-
"README.md",
|
|
45
|
-
"dist",
|
|
46
|
-
"assets",
|
|
47
|
-
"migrations",
|
|
48
|
-
"source-mappings.yaml"
|
|
49
|
-
],
|
|
50
|
-
"scripts": {
|
|
51
|
-
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
52
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
-
"test:built": "node --test ../../tests/ty-context/*.test.mjs",
|
|
54
|
-
"test": "npm run build && node --test ../../tests/ty-context/*.test.mjs",
|
|
55
|
-
"prepack": "npm run build"
|
|
56
|
-
},
|
|
57
|
-
"engines": {
|
|
58
|
-
"node": ">=24"
|
|
59
|
-
},
|
|
60
|
-
"dependencies": {
|
|
61
|
-
"@google/design.md": "^0.3.0",
|
|
62
|
-
"impeccable": "^3.1.0",
|
|
63
|
-
"yaml": "^2.9.0"
|
|
64
|
-
},
|
|
65
|
-
"devDependencies": {
|
|
66
|
-
"@types/node": "^26.0.0",
|
|
67
|
-
"typescript": "^5.5.0"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "project-tiny-context-harness",
|
|
3
|
+
"version": "0.2.82",
|
|
4
|
+
"description": "Minimal project memory and validation harness for AI coding agents.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Seven128",
|
|
7
|
+
"homepage": "https://github.com/Seven128/project-tiny-context-harness#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Seven128/project-tiny-context-harness.git",
|
|
11
|
+
"directory": "packages/ty-context"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Seven128/project-tiny-context-harness/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai-agents",
|
|
18
|
+
"coding-agent",
|
|
19
|
+
"codex",
|
|
20
|
+
"claude-code",
|
|
21
|
+
"cursor",
|
|
22
|
+
"gemini-cli",
|
|
23
|
+
"opencode",
|
|
24
|
+
"agent-context",
|
|
25
|
+
"context-engineering",
|
|
26
|
+
"context-management",
|
|
27
|
+
"agents-md",
|
|
28
|
+
"project-memory",
|
|
29
|
+
"agent-memory",
|
|
30
|
+
"ai-coding",
|
|
31
|
+
"multi-agent",
|
|
32
|
+
"llm",
|
|
33
|
+
"developer-tools",
|
|
34
|
+
"developer-productivity",
|
|
35
|
+
"cli",
|
|
36
|
+
"ty-context",
|
|
37
|
+
"workflow"
|
|
38
|
+
],
|
|
39
|
+
"type": "module",
|
|
40
|
+
"bin": {
|
|
41
|
+
"ty-context": "dist/cli.js"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"README.md",
|
|
45
|
+
"dist",
|
|
46
|
+
"assets",
|
|
47
|
+
"migrations",
|
|
48
|
+
"source-mappings.yaml"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
52
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
+
"test:built": "node --test ../../tests/ty-context/*.test.mjs",
|
|
54
|
+
"test": "npm run build && node --test ../../tests/ty-context/*.test.mjs",
|
|
55
|
+
"prepack": "npm run build"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=24"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@google/design.md": "^0.3.0",
|
|
62
|
+
"impeccable": "^3.1.0",
|
|
63
|
+
"yaml": "^2.9.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@types/node": "^26.0.0",
|
|
67
|
+
"typescript": "^5.5.0"
|
|
68
|
+
}
|
|
69
|
+
}
|