project-tiny-context-harness 0.7.0 → 0.7.2

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 (40) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +323 -319
  3. package/assets/README.md +474 -472
  4. package/assets/README.zh-CN.md +243 -241
  5. package/assets/agents/.gitkeep +1 -1
  6. package/assets/agents/AGENTS_CORE.md +56 -56
  7. package/assets/context_templates/architecture.md +33 -33
  8. package/assets/context_templates/area.md +39 -39
  9. package/assets/context_templates/context.toml +30 -30
  10. package/assets/context_templates/deployment.md +35 -35
  11. package/assets/context_templates/global.md +55 -55
  12. package/assets/context_templates/product-surface-contract.md +63 -63
  13. package/assets/context_templates/verification.md +32 -32
  14. package/assets/github/.gitkeep +1 -1
  15. package/assets/github/harness.yml +41 -41
  16. package/assets/make/.gitkeep +1 -1
  17. package/assets/make/ty-context.mk +48 -48
  18. package/assets/skills/context_development_engineer/SKILL.md +90 -90
  19. package/assets/skills/context_full_project_export/SKILL.md +70 -70
  20. package/assets/skills/context_harness_upgrade/SKILL.md +60 -60
  21. package/assets/skills/context_product_plan/SKILL.md +77 -77
  22. package/assets/skills/context_surface_contract/SKILL.md +171 -171
  23. package/assets/skills/context_uiux_design/SKILL.md +99 -99
  24. package/assets/skills/long-task-workflow/SKILL.md +76 -72
  25. package/assets/skills/long-task-workflow/agents/openai.yaml +4 -4
  26. package/assets/skills/long-task-workflow/references/authority-lifecycle.md +47 -41
  27. package/assets/skills/long-task-workflow/references/contract-authoring.md +58 -43
  28. package/assets/skills/long-task-workflow/references/evidence-design.md +47 -32
  29. package/assets/skills/normal-long-task/SKILL.md +12 -12
  30. package/assets/skills/source-plan-authoring/SKILL.md +295 -295
  31. package/dist/commands/long-task-revision.js +31 -4
  32. package/dist/commands/long-task.js +8 -1
  33. package/dist/lib/long-task-authority-revision-summary.js +33 -2
  34. package/dist/lib/long-task-authority-revision-types.d.ts +6 -0
  35. package/dist/lib/long-task-authority-revision.js +21 -1
  36. package/dist/lib/long-task-status-v2.d.ts +7 -0
  37. package/dist/lib/long-task-status-v2.js +15 -7
  38. package/migrations/README.md +8 -8
  39. package/package.json +1 -1
  40. package/source-mappings.yaml +25 -25
@@ -63,8 +63,21 @@ async function compile(workdir, args) {
63
63
  await clearFinalReceipt(compiled.repository_root, workdir);
64
64
  }
65
65
  await clearAuthorityRevision(workdir);
66
+ printCompileResult(compiled, previous, preserveProgress, revisionCapture.proposal);
67
+ }
68
+ function printCompileResult(compiled, previous, preserveProgress, revisionProposal) {
69
+ const firstAuthorityLock = previous === null;
70
+ const authorityChanged = previous !== null &&
71
+ previous.compiled_identity !== compiled.compiled_identity;
66
72
  console.log(JSON.stringify({
67
73
  status: "compiled",
74
+ lifecycle_event: firstAuthorityLock
75
+ ? "authority_locked"
76
+ : authorityChanged
77
+ ? "authority_revision_adopted"
78
+ : "authority_recompiled_unchanged",
79
+ delivery_completed_by_this_event: false,
80
+ native_goal_effect: "none",
68
81
  task_id: compiled.task.id,
69
82
  compiled_identity: compiled.compiled_identity,
70
83
  authority_revision: compiled.authority_revision,
@@ -72,10 +85,15 @@ async function compile(workdir, args) {
72
85
  outcomes: compiled.outcomes.map((outcome) => outcome.key),
73
86
  claim_coverage: compiled.claim_coverage,
74
87
  progress_preserved: preserveProgress,
75
- authority_revision_change: revisionCapture.proposal
76
- ? projectAuthorityRevisionDecision(revisionCapture.proposal)
88
+ authority_revision_change: revisionProposal
89
+ ? projectAuthorityRevisionDecision(revisionProposal)
77
90
  : null,
78
- execution_model_checkpoint: executionModelCheckpoint(previous === null),
91
+ next_action: firstAuthorityLock
92
+ ? "Complete the one-time model choice, then begin rolling implementation."
93
+ : authorityChanged
94
+ ? "Run status or resume, then continue rolling implementation or repair under the adopted Authority Revision."
95
+ : "Continue rolling implementation or repair under the active Authority.",
96
+ execution_model_checkpoint: executionModelCheckpoint(firstAuthorityLock),
79
97
  }));
80
98
  }
81
99
  async function compileForCommand(workdir, revise, previous, capture) {
@@ -101,8 +119,11 @@ async function printPendingDecision(workdir, previous) {
101
119
  console.log(JSON.stringify({
102
120
  status: "authority_revision_pending",
103
121
  acceptance_authorized: false,
122
+ delivery_completed_by_this_event: false,
123
+ native_goal_effect: "none",
104
124
  active_compiled_identity: previous?.compiled_identity ?? null,
105
125
  pending_authority_revision: projectAuthorityRevisionDecision(pending),
126
+ next_action: "Ask the user to approve or reject this exact material revision; keep the previous Authority active.",
106
127
  }));
107
128
  }
108
129
  async function diagnoseRevision(workdir, args) {
@@ -120,7 +141,13 @@ async function approveRevision(workdir, args) {
120
141
  if (!revision)
121
142
  throw new Error("--revision requires a value");
122
143
  await approvePendingAuthorityRevision(workdir, revision);
123
- console.log(JSON.stringify({ status: "authority_revision_approved", revision }));
144
+ console.log(JSON.stringify({
145
+ status: "authority_revision_approved",
146
+ revision,
147
+ delivery_completed_by_this_event: false,
148
+ native_goal_effect: "none",
149
+ next_action: "Run compile --revise to atomically adopt the approved revision, then return to rolling implementation or repair.",
150
+ }));
124
151
  }
125
152
  function executionModelCheckpoint(firstAuthorityLock) {
126
153
  if (!firstAuthorityLock)
@@ -68,6 +68,9 @@ export async function longTask(args) {
68
68
  workdir,
69
69
  workflow_status: result.workflow_status,
70
70
  external_confirmations: result.external_confirmations,
71
+ acceptance_scope: result.acceptance_scope,
72
+ closed_scope: result.closed_scope,
73
+ native_goal_effect: result.native_goal_effect,
71
74
  }));
72
75
  return;
73
76
  }
@@ -101,7 +104,11 @@ async function verify(workdir, args) {
101
104
  async function finalGate(workdir, args) {
102
105
  rejectUnknown(args, []);
103
106
  const result = await runDeliveryFinalGate(workdir);
104
- console.log(JSON.stringify(result));
107
+ console.log(JSON.stringify({
108
+ ...result,
109
+ acceptance_scope: "declared_machine_authority",
110
+ native_goal_effect: "none",
111
+ }));
105
112
  if (result.workflow_status !== "machine_accepted" &&
106
113
  result.workflow_status !== "machine_accepted_external_pending")
107
114
  process.exitCode = 1;
@@ -57,6 +57,21 @@ export function summarizeAuthorityRevision(diff, outcomeKeys) {
57
57
  write_scope_expanded: diff.owner_or_path_boundary_changed,
58
58
  risk_changed: diff.risk_changed,
59
59
  external_confirmations_changed: diff.external_confirmations_changed,
60
+ semantic_fields_changed: uniqueSorted([
61
+ ...diff.product_semantics_changed,
62
+ ...diff.global_semantics_changed,
63
+ ]),
64
+ source_claim_changes: uniqueSorted([
65
+ ...diff.source_claims_added,
66
+ ...diff.source_claims_removed_or_changed,
67
+ ]),
68
+ product_claim_changes: uniqueSorted([
69
+ ...diff.product_claims_added.map((claim) => `${claim}:added`),
70
+ ...diff.product_claims_removed.map((claim) => `${claim}:removed`),
71
+ ...diff.product_claims_changed.map((claim) => `${claim}:changed`),
72
+ ]),
73
+ proof_reductions: uniqueSorted(diff.reduction_reasons.filter((reason) => PROOF_REDUCTION_REASONS.has(reason))),
74
+ external_confirmation_changes: uniqueSorted(diff.external_confirmation_changes),
60
75
  added_verification_dependencies: uniqueSorted([
61
76
  ...diff.verification_inputs_added,
62
77
  ...diff.input_paths_added,
@@ -76,13 +91,29 @@ export function projectAuthorityRevisionDecision(value) {
76
91
  verification_inputs_added: value.revision_diff.verification_inputs_added ?? [],
77
92
  input_paths_added: value.revision_diff.input_paths_added ?? [],
78
93
  external_confirmations_changed: value.revision_diff.external_confirmations_changed ?? false,
94
+ external_confirmation_changes: value.revision_diff.external_confirmation_changes ?? [],
79
95
  };
96
+ const computedSummary = summarizeAuthorityRevision(diff, value.affected_outcomes_or_contracts);
97
+ const storedSummary = value.approval_summary;
80
98
  return {
81
99
  revision_identity: value.revision_identity,
82
100
  change_class: value.change_class ?? classifyAuthorityRevision(diff),
83
101
  approval_required: value.approval_required ?? true,
84
- approval_summary: value.approval_summary ??
85
- summarizeAuthorityRevision(diff, value.affected_outcomes_or_contracts),
102
+ approval_summary: storedSummary
103
+ ? {
104
+ ...computedSummary,
105
+ ...storedSummary,
106
+ semantic_fields_changed: storedSummary.semantic_fields_changed ??
107
+ computedSummary.semantic_fields_changed,
108
+ source_claim_changes: storedSummary.source_claim_changes ??
109
+ computedSummary.source_claim_changes,
110
+ product_claim_changes: storedSummary.product_claim_changes ??
111
+ computedSummary.product_claim_changes,
112
+ proof_reductions: storedSummary.proof_reductions ?? computedSummary.proof_reductions,
113
+ external_confirmation_changes: storedSummary.external_confirmation_changes ??
114
+ computedSummary.external_confirmation_changes,
115
+ }
116
+ : computedSummary,
86
117
  };
87
118
  }
88
119
  function scopeAffectedOutcomes(diff) {
@@ -10,6 +10,11 @@ export interface AuthorityRevisionApprovalSummaryV2 {
10
10
  write_scope_expanded: boolean;
11
11
  risk_changed: boolean;
12
12
  external_confirmations_changed: boolean;
13
+ semantic_fields_changed: string[];
14
+ source_claim_changes: string[];
15
+ product_claim_changes: string[];
16
+ proof_reductions: string[];
17
+ external_confirmation_changes: string[];
13
18
  added_verification_dependencies: string[];
14
19
  expanded_owner_paths: string[];
15
20
  expanded_expected_change_paths: string[];
@@ -79,6 +84,7 @@ export interface AuthorityRevisionDiffV2 {
79
84
  counterfactuals_removed: string[];
80
85
  population_weakened: string[];
81
86
  external_confirmations_changed: boolean;
87
+ external_confirmation_changes: string[];
82
88
  verifier_content_changed: boolean;
83
89
  verifier_runtime_locator_changed: boolean;
84
90
  verifier_files_changed: string[];
@@ -80,7 +80,8 @@ export function authorityRevisionDiff(previous, next, nextHashes, nextMaterials,
80
80
  const riskChanged = previous.authority_hashes.risk_authority_hash !==
81
81
  nextHashes.risk_authority_hash;
82
82
  const acceptanceChanged = acceptanceSemanticsChanged(previous, next);
83
- const externalConfirmationsChanged = !same(previous.global.acceptance.external_confirmations, next.global.acceptance.external_confirmations);
83
+ const externalConfirmationChanges = keyedAuthorityChanges(previous.global.acceptance.external_confirmations, next.global.acceptance.external_confirmations);
84
+ const externalConfirmationsChanged = externalConfirmationChanges.length > 0;
84
85
  const monotonic = isMonotonicAcceptanceStrengthening(previous, next);
85
86
  const reductionReasons = [
86
87
  ...(productClaimsAdded.length ? ["product_claim_added"] : []),
@@ -175,6 +176,7 @@ export function authorityRevisionDiff(previous, next, nextHashes, nextMaterials,
175
176
  counterfactuals_removed: counterfactualsRemoved,
176
177
  population_weakened: populationWeakened,
177
178
  external_confirmations_changed: externalConfirmationsChanged,
179
+ external_confirmation_changes: externalConfirmationChanges,
178
180
  ...verifierDiff,
179
181
  source_claims_changed: previous.authority_hashes.source_authority_hash !==
180
182
  nextHashes.source_authority_hash,
@@ -194,3 +196,21 @@ export function authorityRevisionDiff(previous, next, nextHashes, nextMaterials,
194
196
  reduction_reasons: [...new Set(reductionReasons)],
195
197
  };
196
198
  }
199
+ function keyedAuthorityChanges(before, after) {
200
+ const beforeByKey = new Map(before.map((item) => [item.key, item]));
201
+ const afterByKey = new Map(after.map((item) => [item.key, item]));
202
+ return [
203
+ ...before
204
+ .filter((item) => !afterByKey.has(item.key))
205
+ .map((item) => `${item.key}:removed`),
206
+ ...after
207
+ .filter((item) => !beforeByKey.has(item.key))
208
+ .map((item) => `${item.key}:added`),
209
+ ...before
210
+ .filter((item) => {
211
+ const candidate = afterByKey.get(item.key);
212
+ return candidate !== undefined && !same(item, candidate);
213
+ })
214
+ .map((item) => `${item.key}:changed`),
215
+ ].sort();
216
+ }
@@ -8,6 +8,8 @@ export interface DeliveryStatusV2 {
8
8
  effective_risk: "standard" | "strict";
9
9
  workspace_snapshot_sha256: string;
10
10
  acceptance_authority: "live_final_gate_required";
11
+ acceptance_scope: "declared_machine_authority";
12
+ native_goal_effect: "none";
11
13
  final_result: AuditGateStatusV2;
12
14
  final_workflow_status: FinalReceiptV2["workflow_status"] | null;
13
15
  external_confirmations: ExternalConfirmationV2[];
@@ -29,11 +31,16 @@ export interface StopCheckDeliveryResultV2 {
29
31
  reason: string;
30
32
  workflow_status?: FinalReceiptV2["workflow_status"];
31
33
  external_confirmations?: ExternalConfirmationV2[];
34
+ acceptance_scope?: "declared_machine_authority";
35
+ native_goal_effect?: "none";
32
36
  message?: string;
33
37
  }
34
38
  export interface CloseDeliveryResultV2 {
35
39
  status: "closed";
36
40
  workflow_status: Extract<FinalReceiptV2["workflow_status"], "machine_accepted" | "machine_accepted_external_pending">;
37
41
  external_confirmations: ExternalConfirmationV2[];
42
+ acceptance_scope: "declared_machine_authority";
43
+ closed_scope: "machine_authority";
44
+ native_goal_effect: "none";
38
45
  }
39
46
  export declare function closeDeliveryTask(workdir: string): Promise<CloseDeliveryResultV2>;
@@ -48,6 +48,8 @@ async function readDeliveryStatusForAuthority(active) {
48
48
  effective_risk: compiled.effective_risk,
49
49
  workspace_snapshot_sha256: current.snapshot_sha256,
50
50
  acceptance_authority: "live_final_gate_required",
51
+ acceptance_scope: "declared_machine_authority",
52
+ native_goal_effect: "none",
51
53
  final_result: projection.finalResult,
52
54
  final_workflow_status: projection.finalWorkflowStatus,
53
55
  external_confirmations: compiled.global.acceptance.external_confirmations,
@@ -94,6 +96,8 @@ export async function resumeDeliveryTask(workdir) {
94
96
  context_refs: compiled.task.context_refs,
95
97
  git,
96
98
  acceptance_authority: "live_final_gate_required",
99
+ acceptance_scope: "declared_machine_authority",
100
+ native_goal_effect: "none",
97
101
  last_gate: status.final_result,
98
102
  final_workflow_status: status.final_workflow_status,
99
103
  external_confirmations: status.external_confirmations,
@@ -221,11 +225,9 @@ export async function stopCheckDeliveryTask(workdirInput, messageText = "") {
221
225
  reason: result.workflow_status,
222
226
  workflow_status: result.workflow_status,
223
227
  external_confirmations: result.external_confirmations,
224
- ...(result.workflow_status === "machine_accepted_external_pending"
225
- ? {
226
- message: externalPendingMessage(result.external_confirmations),
227
- }
228
- : {}),
228
+ acceptance_scope: "declared_machine_authority",
229
+ native_goal_effect: "none",
230
+ message: acceptedScopeMessage(result.workflow_status, result.external_confirmations),
229
231
  };
230
232
  }
231
233
  return {
@@ -272,13 +274,19 @@ export async function closeDeliveryTask(workdir) {
272
274
  status: "closed",
273
275
  workflow_status: result.workflow_status,
274
276
  external_confirmations: result.external_confirmations,
277
+ acceptance_scope: "declared_machine_authority",
278
+ closed_scope: "machine_authority",
279
+ native_goal_effect: "none",
275
280
  };
276
281
  }
277
- function externalPendingMessage(confirmations) {
282
+ function acceptedScopeMessage(workflowStatus, confirmations) {
283
+ const scope = "Declared machine Authority accepted and cleared. This result has no direct effect on the platform-native Goal; before completing it, confirm current Goal/user meaning is fully represented by accepted Source and no revision, blocker, or omitted requirement remains.";
284
+ if (workflowStatus === "machine_accepted")
285
+ return scope;
278
286
  const pending = confirmations
279
287
  .map((confirmation) => `${confirmation.key} (${confirmation.owner})`)
280
288
  .join(", ");
281
- return `Machine-verifiable scope accepted. Complete external delivery remains pending: ${pending}. Do not report complete external delivery.`;
289
+ return `${scope} Complete external delivery remains pending: ${pending}. Do not report complete external delivery.`;
282
290
  }
283
291
  function nextAction(status) {
284
292
  if (status.pending_authority_revision)
@@ -1,8 +1,8 @@
1
- # Migrations
2
-
3
- Schema migrations for Harness config and managed file layout belong here.
4
-
5
- Version 0.6.0 includes `long-task-v1-retirement`. It safely removes the
6
- retired repo-local Hook, reports a legacy active projection as
7
- `manual_required`, and deliberately does not import V1 progress or receipts
8
- into the V2 Claim/Evidence authority.
1
+ # Migrations
2
+
3
+ Schema migrations for Harness config and managed file layout belong here.
4
+
5
+ Version 0.6.0 includes `long-task-v1-retirement`. It safely removes the
6
+ retired repo-local Hook, reports a legacy active projection as
7
+ `manual_required`, and deliberately does not import V1 progress or receipts
8
+ into the V2 Claim/Evidence authority.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-tiny-context-harness",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Minimal project memory and validation harness for AI coding agents.",
5
5
  "license": "MIT",
6
6
  "author": "Seven128",
@@ -1,25 +1,25 @@
1
- source_mappings:
2
- - source: ".codex/ty-context-managed/agents/AGENTS_CORE.md"
3
- target: "packages/ty-context/assets/agents/AGENTS_CORE.md"
4
- mode: "copy-file"
5
- - source: "README.md"
6
- target: "packages/ty-context/assets/README.md"
7
- mode: "copy-file"
8
- - source: "README.zh-CN.md"
9
- target: "packages/ty-context/assets/README.zh-CN.md"
10
- mode: "copy-file"
11
- - source: ".codex/ty-context-managed/context_templates"
12
- target: "packages/ty-context/assets/context_templates"
13
- mode: "copy-tree"
14
- - source: ".codex/ty-context-managed/skills"
15
- target: "packages/ty-context/assets/skills"
16
- mode: "copy-tree"
17
- - source: ".codex/ty-context-managed/make/ty-context.mk"
18
- target: "packages/ty-context/assets/make/ty-context.mk"
19
- mode: "copy-file"
20
- - source: ".codex/ty-context-managed/minimal_tools"
21
- target: "packages/ty-context/assets/tools"
22
- mode: "copy-tree"
23
- - source: ".github/workflows/harness.yml"
24
- target: "packages/ty-context/assets/github/harness.yml"
25
- mode: "copy-file"
1
+ source_mappings:
2
+ - source: ".codex/ty-context-managed/agents/AGENTS_CORE.md"
3
+ target: "packages/ty-context/assets/agents/AGENTS_CORE.md"
4
+ mode: "copy-file"
5
+ - source: "README.md"
6
+ target: "packages/ty-context/assets/README.md"
7
+ mode: "copy-file"
8
+ - source: "README.zh-CN.md"
9
+ target: "packages/ty-context/assets/README.zh-CN.md"
10
+ mode: "copy-file"
11
+ - source: ".codex/ty-context-managed/context_templates"
12
+ target: "packages/ty-context/assets/context_templates"
13
+ mode: "copy-tree"
14
+ - source: ".codex/ty-context-managed/skills"
15
+ target: "packages/ty-context/assets/skills"
16
+ mode: "copy-tree"
17
+ - source: ".codex/ty-context-managed/make/ty-context.mk"
18
+ target: "packages/ty-context/assets/make/ty-context.mk"
19
+ mode: "copy-file"
20
+ - source: ".codex/ty-context-managed/minimal_tools"
21
+ target: "packages/ty-context/assets/tools"
22
+ mode: "copy-tree"
23
+ - source: ".github/workflows/harness.yml"
24
+ target: "packages/ty-context/assets/github/harness.yml"
25
+ mode: "copy-file"