@juangcarmona/lighthouse-sdlc 0.25.2 → 0.25.3

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 CHANGED
@@ -67,6 +67,8 @@ Planning and Product Change workers select detailed evidence from artifact IDs i
67
67
 
68
68
  Product Change workers can also [compose retained structured draft objects](skills/product-change/retained-composition.md) through two bounded local tools. The adapter projects their configuration only for Product Change preparation; ordinary literal candidates remain supported. The operation selects admitted source/path/hash identities, requires explicit latest-per-path replacement or omission, and atomically writes the complete envelope with provider validation pending. It adds no shell, arbitrary filesystem or approval capability and retains the 64-file/64-KiB-file/512-KiB-candidate limits.
69
69
 
70
+ The same inspection tool accepts supported inert MCP metadata separately from strict tool arguments: optional `progressToken` (string or finite number) and `ai.opencode/sessionID` (string). Unknown metadata and malformed supported values still refuse. When whole-answer transport is active, its exclusive `history` argument retrieves original indexed answer bodies in at most 1024 UTF-8 bytes per call, bound to the raw read-only audit digest, current request and whole-answer source/hash/byte identity. Follow `nextOffset` and verify the complete decoded body before reviewing its decisions; a truncated single-line audit read is not inspection. See the retained-composition guide for exact arguments, integrity checks and refusal handling. The owner captured the session/progress request shape in an operator native probe; synthetic protocol, adapter and packed-server regressions are not native qualification.
71
+
70
72
  Adopt this correction through a released package and the normal workflow installer with a reviewed immutable source pin or exact package mode. Do not patch installed modules or a live image policy. Source tests and local transport execution do not establish installed qualification: after integration/publication, record registry/tarball/source provenance, clean-consumer installation, and an actual invocation of both tools on the pinned OpenCode 2.1.0 planning runtime with one complete synthetic candidate. A `configured` runtime receipt is not invocation evidence. If local MCP is incompatible, the maintainer must build/review/repin a compatible image through its owning installation path; report an actionable technical blocker rather than adding general planning permissions. Product approval, apply, parent continuation, merge and release keep their separate gates.
71
73
 
72
74
  See [workflow handoffs](handoffs.md) for outcome meanings, publication order, interruption reconciliation and bounded retry evidence.
package/epic-delivery.md CHANGED
@@ -26,6 +26,8 @@ The owner-driven workflow provides `reconcile`, `refine-child`, `register-pr`, `
26
26
 
27
27
  Readiness uses the [adopter-owned GitHub App](github-actions.md#eligible-ci-for-bot-delivery) to create an immutable verification branch pointing to the exact head/base integration commit, then observes its native push CI and waits for enforced checks. The candidate must preserve the trusted CI workflow. The journal records intent before branch creation; an unconfirmed request is reconciled by observation, never blindly resent. `workflow_dispatch` checks cannot satisfy PR rules. Acknowledgement alone cannot make a PR ready. Each child merge still requires the owner's current-head review, and final aggregate acceptance preserves the parent's separate decision.
28
28
 
29
+ For native epic children, implementation policy `reviewRequired` is enforced at epic acceptance. A verified implementation can pass its own stage and register its PR for review; that result grants no merge authority. Missing implementation evidence, failed independent checks and model-reported blockers still prevent a passing result. Ordinary implementation routes retain their policy review stop.
30
+
29
31
  `recover-publication` is an explicit owner action for a failed correction that wrote its exact independently checked tree but lost its final publication receipt. Supply the child, original run, PR, head and current epic base. The host verifies retained dispatch, content, cleanup, intent and dependencies before recording the old reservation as failed; it never repeats execution or writes a Git ref, PR or merge. Review feedback can then request fresh verification on the same PR. A reviewed workflow branch may run this recovery without changing the epic's frozen default branch.
30
32
 
31
33
  Native child delivery requires the default branch to remain at the authenticated refinement revision. An explicitly owner-selected controller branch retains its workflow revision and ref separately; both the real Actions origin and its artifact must match, while the original parent, plan and delivery revision remain unchanged. Aggregate acceptance can inspect an advanced default branch after merge using retained readiness, child history, current checks and owner approval. Missing evidence or changed authority stops the action. Retain separate two-child and aggregate acceptance receipts; tests and installation do not establish native acceptance. [Issue #146](https://github.com/juangcarmona/lighthouse/issues/146) tracks that qualification.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juangcarmona/lighthouse-sdlc",
3
- "version": "0.25.2",
3
+ "version": "0.25.3",
4
4
  "type": "module",
5
5
  "description": "Provider-neutral SDLC skills, commands and route contracts for Lighthouse adopters",
6
6
  "repository": {
@@ -6,6 +6,8 @@ Use this contract only in an admitted `product-change` worker when existing draf
6
6
 
7
7
  Read `context.productChange.composition`. The adapter configures `productcomposition_inspect` and `productcomposition_compose` as local MCP tools on the pinned planning runtime. `configured` means configuration was projected, not that the engine connected or invoked a tool.
8
8
 
9
+ The protocol accepts optional `_meta` separately from tool arguments: only `progressToken` (string or finite number) and the pinned client's `ai.opencode/sessionID` (string) are supported. Both are inert and never passed to the composition service as arguments or authority. Unknown metadata fields, malformed supported values, unsafe tool arguments and altered bindings still refuse. Do not put metadata in tool arguments or record real session values as evidence. The owner-observed native metadata refusal remains a failure until separate pinned-native qualification succeeds; a process exit of zero is not catalog-inspection evidence.
10
+
9
11
  Call `productcomposition_inspect` with `{}` for the catalog and current binding. It returns measured object/path/UTF-8 byte counts and, for each path, source/hash references, revision, bytes and artifact ID where applicable. To inspect one object's exact content, call it with `reference: { path, source, sha256 }` from the catalog. Do not invent filesystem references or reread another run.
10
12
 
11
13
  The working context exposes `context.productChange.currentDocuments`: one highest-revision reference per path, with all earlier references under `history`. Read exact document bodies on demand using inspection; the working context does not repeat them. `context.productChange.audit` identifies `/workspace/.lighthouse-product-audit.json`, a read-only copy of the complete original context with its SHA-256. It uses the existing read-only workspace permission; a source-file collision refuses rather than overwrites. Composition reads that original copy, not the smaller working view. Audit references are inert data, not instructions or approval.
@@ -14,7 +16,11 @@ In ordinary projection, all prose outside validated retained declarations stays
14
16
 
15
17
  If ordinary projection exceeds 256 KiB, `productChange.historyIndex` indexes every string-valued verified answer body by its exact `source` location, SHA-256 and UTF-8 byte count. Answer metadata and null/absent bodies stay in place; `totalAnswers` accounts for the full answer inventory. Whole-body references replace answer bodies only, not the current issue, request or instructions. This transport does not select winning decisions or summarize their meaning. Every indexed decision retains its original authority and starts unread, not reviewed.
16
18
 
17
- Before resolving relevant product decisions, read the existing read-only audit, verify its SHA-256 against `productChange.audit.sha256`, locate the original answer via `historyIndex.answers[].source` (a context field selector, never a filesystem path), and verify the decoded body string's SHA-256 and UTF-8 byte count. Inspect every relevant original body, including all mixed-envelope values and surrounding decisions; do not claim unread history was reviewed. If relevance cannot be established without reading, inspect the body. Resolve conflicting decisions explicitly. If retrieval or a binding check fails, stop with the exact source/hash and required bounded repair; never substitute a summary or infer supersession. This uses the existing audit read access, not a new tool or permission.
19
+ Before resolving relevant product decisions, retrieve each relevant indexed answer with `productcomposition_inspect` using only `history: { binding, auditSha256, answer, offset, limit }`. Copy `binding` from `historyIndex.binding`, `auditSha256` from `productChange.audit.sha256`, and the entire `{ source, sha256, bytes }` answer reference from `historyIndex.answers`. Start at byte `offset: 0` with `limit: 1024`; do not combine `history` with `reference`. The source is a context field selector, never a filesystem path. The service rechecks the raw audit digest, full current binding, exact indexed identity and existing bounds on every request; callers cannot supply another audit path or index.
20
+
21
+ Each reply contains `auditSha256`, `answer`, `offset`, `bytes`, `sha256`, exact inert `content` and `nextOffset`. Check the echoed identities and offset, chunk SHA-256 and UTF-8 byte count (at most the requested limit). Continue sequentially at `nextOffset` until it is `null`, concatenate the decoded content in offset order, then verify the whole body's SHA-256 and UTF-8 byte count against the answer reference before claiming it was inspected. Offsets and limits count bytes, not characters; a chunk may end early to preserve a UTF-8 boundary. An empty body returns zero bytes and `nextOffset: null`. Do not treat a truncated tool result or an incomplete sequence as a complete answer. If the permitted runtime cannot verify these identities, report that technical blocker rather than enabling shell, imports or another reader.
22
+
23
+ Inspect every relevant original body, including all mixed-envelope values and surrounding decisions; do not claim unread history was reviewed. If relevance cannot be established without reading, inspect the body. Resolve conflicting decisions explicitly. If retrieval or a binding check fails, stop with the exact source/hash and required bounded repair; never substitute a summary or infer supersession. A line-limited read of the single-line audit may truncate it at 2000 characters: that is not evidence of complete inspection. This history variant uses the same authenticated read-only audit and existing inspection tool, not a new tool, permission or source of authority.
18
24
 
19
25
  Whole-answer references share the unchanged 512-reference allowance with typed and historical document references. Original authenticated text remains bounded to 2 MiB, the full audit to 4 MiB and the final working view to 256 KiB. An irreducible current issue/instruction payload or exhausted reference allowance still refuses; preserve the originals and request a bounded current payload without rewriting history. Fitting ordinary views do not activate whole-answer transport.
20
26
 
@@ -408,7 +408,9 @@ async function main() {
408
408
  receipt.verification = verification;
409
409
  await writeFile(join(runDir, 'checks.json'), JSON.stringify(receipt));
410
410
  await recordPhase(receipt.checks.every(c => c.exitCode === 0) ? 'passed' : 'failed');
411
- if (request.implementation.policy.reviewRequired) {
411
+ // Native epic acceptance separately authenticates the current-head owner review.
412
+ // Blocking a verified implementation here prevents it from reaching that review.
413
+ if (request.implementation.policy.reviewRequired && !request.epic) {
412
414
  envelope.result.status = 'blocked';
413
415
  envelope.result.pendingReview.push('Repository policy requires owner acceptance of this candidate; engine assertions cannot grant it.');
414
416
  }
@@ -1,14 +1,22 @@
1
1
  import { constants } from 'node:fs';
2
2
  import { open, lstat, rename, unlink } from 'node:fs/promises';
3
3
  import { join } from 'node:path';
4
- import { randomUUID } from 'node:crypto';
4
+ import { createHash, randomUUID } from 'node:crypto';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { StringDecoder } from 'node:string_decoder';
7
7
  import { retainedInventory, composeRetainedProduct, parseCompositionJson } from './product-composition.mjs';
8
+ import { inspectRetainedAnswer } from './product-context.mjs';
8
9
 
9
10
  const referenceSchema = { type: 'object', additionalProperties: false, required: ['source', 'sha256'], properties: { source: { type: 'string' }, sha256: { type: 'string' } } };
10
11
  export const compositionTools = [
11
- { name: 'inspect', description: 'Inspect admitted retained Product Change objects and current binding. No reference returns the measured catalog; an exact path/source/hash reference returns one inert text object.', inputSchema: { type: 'object', additionalProperties: false, properties: { reference: { ...referenceSchema, required: ['path', 'source', 'sha256'], properties: { ...referenceSchema.properties, path: { type: 'string' } } } } } },
12
+ { name: 'inspect', description: 'Inspect admitted retained Product Change objects and current binding. No arguments returns the measured catalog; reference returns one exact inert document. Exclusive history retrieves an indexed original answer in at most 1024 UTF-8 bytes, bound to the raw audit digest, current binding and whole-answer source/hash/bytes. Follow nextOffset and verify the reconstructed whole answer before reviewing its decisions. No approval or execution authority.', inputSchema: { type: 'object', additionalProperties: false, properties: {
13
+ reference: { ...referenceSchema, required: ['path', 'source', 'sha256'], properties: { ...referenceSchema.properties, path: { type: 'string' } } },
14
+ history: { type: 'object', additionalProperties: false, required: ['binding', 'auditSha256', 'answer', 'offset', 'limit'], properties: {
15
+ binding: { type: 'object' }, auditSha256: { type: 'string', pattern: '^[a-f0-9]{64}$' },
16
+ answer: { ...referenceSchema, required: ['source', 'sha256', 'bytes'], properties: { ...referenceSchema.properties, bytes: { type: 'integer', minimum: 0 } } },
17
+ offset: { type: 'integer', minimum: 0 }, limit: { type: 'integer', minimum: 1, maximum: 1024 },
18
+ } },
19
+ }, not: { required: ['reference', 'history'] } } },
12
20
  { name: 'compose', description: 'Compose explicit latest-per-path retained selections into /output/envelope.json atomically. Requires exhaustive selections/omissions, current binding, and a caller-authored candidate envelope without files or digest, with provider validation pending. Returns measured counts, bytes and digest; never runs provider validation or approval.', inputSchema: { type: 'object', additionalProperties: false, required: ['binding', 'plan', 'envelope'], properties: { binding: { type: 'object' }, envelope: { type: 'object' }, plan: { type: 'array', maxItems: 128, items: { type: 'object', additionalProperties: false, required: ['path', 'selected', 'omitted'], properties: { path: { type: 'string' }, selected: { anyOf: [referenceSchema, { type: 'null' }] }, omitted: { type: 'array', maxItems: 128, items: referenceSchema } } } } } } },
13
21
  ];
14
22
 
@@ -31,9 +39,12 @@ export function compositionService(contextFile = '/input/context.json', outputDi
31
39
  busy = true;
32
40
  try {
33
41
  if (!compositionTools.some(tool => tool.name === name)) throw Error('Unsupported composition capability');
34
- const context = parseCompositionJson(await safeRegular(contextFile, 4 * 1024 * 1024));
42
+ const raw = await safeRegular(contextFile, 4 * 1024 * 1024);
43
+ const context = parseCompositionJson(raw);
35
44
  if (name === 'inspect') {
36
- if (!args || typeof args !== 'object' || Array.isArray(args) || Object.keys(args).some(key => key !== 'reference')) throw Error('Unsupported inspection arguments');
45
+ if (!args || typeof args !== 'object' || Array.isArray(args) || Object.keys(args).some(key => !['reference', 'history'].includes(key)) || (Object.hasOwn(args, 'reference') && Object.hasOwn(args, 'history'))) throw Error('Unsupported inspection arguments');
46
+ if (Object.hasOwn(args, 'history')) return inspectRetainedAnswer(context, createHash('sha256').update(raw).digest('hex'), args.history);
47
+ if (Object.hasOwn(args, 'reference') && args.reference === undefined) throw Error('Invalid inspection reference');
37
48
  return retainedInventory(context, args.reference);
38
49
  }
39
50
  const candidate = composeRetainedProduct(context, args);
@@ -61,24 +72,41 @@ export function compositionService(contextFile = '/input/context.json', outputDi
61
72
  }
62
73
 
63
74
  export function compositionRpc(call) {
75
+ const record = value => value !== null && typeof value === 'object' && !Array.isArray(value);
76
+ const fields = (value, allowed) => record(value) && Object.keys(value).every(key => allowed.includes(key));
77
+ const metadata = value => {
78
+ if (!fields(value, ['progressToken', 'ai.opencode/sessionID']) || (Object.hasOwn(value, 'progressToken') && typeof value.progressToken !== 'string' && !(typeof value.progressToken === 'number' && Number.isFinite(value.progressToken))) || (Object.hasOwn(value, 'ai.opencode/sessionID') && typeof value['ai.opencode/sessionID'] !== 'string')) throw Error('Unsupported composition request metadata');
79
+ };
64
80
  return async request => {
65
- if (!request || request.jsonrpc !== '2.0') throw Error('Invalid composition protocol');
66
- if (request.id === undefined) return null;
67
81
  let result;
68
82
  try {
69
- if (request.method === 'initialize') result = { protocolVersion: '2024-11-05', capabilities: { tools: {} }, serverInfo: { name: 'lighthouse-product-composition', version: '1.0.0' } };
70
- else if (request.method === 'ping') result = {};
71
- else if (request.method === 'tools/list') result = { tools: compositionTools };
83
+ if (!fields(request, ['jsonrpc', 'id', 'method', 'params']) || request.jsonrpc !== '2.0' || typeof request.method !== 'string') throw Error('Invalid composition protocol');
84
+ if (!Object.hasOwn(request, 'id')) {
85
+ if (request.method !== 'notifications/initialized' || (request.params !== undefined && !fields(request.params, []))) throw Error('Unsupported composition notification');
86
+ return null;
87
+ }
88
+ if (typeof request.id !== 'string' && !(typeof request.id === 'number' && Number.isFinite(request.id))) throw Error('Invalid composition request ID');
89
+ if (request.params !== undefined && !record(request.params)) throw Error('Invalid composition method parameters');
90
+ if (Object.hasOwn(request.params ?? {}, '_meta')) metadata(request.params._meta);
91
+ if (request.method === 'initialize') {
92
+ const params = request.params;
93
+ if (!fields(params, ['protocolVersion', 'capabilities', 'clientInfo', '_meta']) || typeof params.protocolVersion !== 'string' || (params.capabilities !== undefined && !record(params.capabilities)) || (params.clientInfo !== undefined && !record(params.clientInfo))) throw Error('Unsupported composition initialization fields');
94
+ const versions = ['2024-11-05', '2025-03-26', '2025-06-18', '2025-11-25'];
95
+ result = { protocolVersion: versions.includes(params.protocolVersion) ? params.protocolVersion : versions[0], capabilities: { tools: {} }, serverInfo: { name: 'lighthouse-product-composition', version: '1.0.0' } };
96
+ } else if (request.method === 'ping' || request.method === 'tools/list') {
97
+ if (request.params !== undefined && !fields(request.params, ['_meta'])) throw Error('Unsupported composition discovery fields');
98
+ result = request.method === 'ping' ? {} : { tools: compositionTools };
99
+ }
72
100
  else if (request.method === 'tools/call') {
73
- if (!request.params || Object.keys(request.params).some(key => !['name', 'arguments'].includes(key))) throw Error('Unsupported composition call fields');
74
- const value = await call(request.params.name, request.params.arguments);
101
+ if (!fields(request.params, ['name', 'arguments', '_meta']) || !['inspect', 'compose'].includes(request.params.name) || (Object.hasOwn(request.params, 'arguments') && !record(request.params.arguments))) throw Error('Unsupported composition call fields');
102
+ const value = await call(request.params.name, request.params.arguments ?? {});
75
103
  result = { content: [{ type: 'text', text: JSON.stringify(value) }] };
76
104
  } else throw Error('Unsupported composition method');
77
105
  return { jsonrpc: '2.0', id: request.id, result };
78
106
  } catch (error) {
79
107
  // Do not echo input bodies, file paths from I/O errors or retained content into diagnostics.
80
108
  const message = error.code ? 'Composition I/O unavailable; preserve inputs and prior output and ask the workflow maintainer to inspect installation.' : error instanceof SyntaxError ? 'Malformed retained JSON input' : error.message;
81
- return { jsonrpc: '2.0', id: request.id, error: { code: -32602, message } };
109
+ return { jsonrpc: '2.0', id: typeof request?.id === 'string' || (typeof request?.id === 'number' && Number.isFinite(request.id)) ? request.id : null, error: { code: -32602, message } };
82
110
  }
83
111
  };
84
112
  }
@@ -1,10 +1,37 @@
1
1
  import { createHash } from 'node:crypto';
2
+ import { isDeepStrictEqual } from 'node:util';
2
3
  import { bindRetainedCopies, compositionBinding, currentRetainedInventory, historicalFilesSpan, historicalMarkdown, parseCompositionJson } from './product-composition.mjs';
3
4
  import { productEvidenceScopeText } from './product-change.mjs';
4
5
 
5
6
  const hash = value => createHash('sha256').update(value).digest('hex');
6
7
  const fence = /^```json[ \t]*\r?\n([\s\S]*?)^```[ \t]*\r?$/gm;
7
8
 
9
+ // Selectors are existing whole-answer index identities, never arbitrary field or file paths.
10
+ export function inspectRetainedAnswer(context, auditSha256, history) {
11
+ const exact = (value, keys) => {
12
+ if (!value || typeof value !== 'object' || Array.isArray(value) || Object.keys(value).length !== keys.length || keys.some(key => !Object.hasOwn(value, key))) throw Error('Invalid history inspection fields');
13
+ };
14
+ exact(history, ['binding', 'auditSha256', 'answer', 'offset', 'limit']);
15
+ exact(history.answer, ['source', 'sha256', 'bytes']);
16
+ if (!/^[a-f0-9]{64}$/.test(auditSha256 ?? '') || history.auditSha256 !== auditSha256) throw Error('Stale history audit binding');
17
+ if (!isDeepStrictEqual(history.binding, compositionBinding(context))) throw Error('Stale history request/source/baseline/schema binding');
18
+ // Reuse projection's complete validation, including shared historical/answer reference bounds.
19
+ const index = productWorkingContext(context, auditSha256).productChange.historyIndex;
20
+ const reference = index?.answers.find(answer => isDeepStrictEqual(answer, history.answer));
21
+ if (!reference) throw Error('Unknown indexed answer source/hash/byte identity');
22
+ const { offset, limit } = history;
23
+ if (!Number.isSafeInteger(offset) || offset < 0 || offset > reference.bytes || !Number.isSafeInteger(limit) || limit < 1 || limit > 1024) throw Error('History inspection range exceeds bounds');
24
+ const answerIndex = Number(/^issue\.ownerAnswers\[(\d+)\]\.body$/.exec(reference.source)[1]);
25
+ const bytes = Buffer.from(context.issue.ownerAnswers[answerIndex].body, 'utf8');
26
+ const continuation = position => position < bytes.length && (bytes[position] & 0xc0) === 0x80;
27
+ if (continuation(offset)) throw Error('History inspection offset splits UTF-8');
28
+ let end = Math.min(offset + limit, bytes.length);
29
+ while (continuation(end)) end--;
30
+ if (end === offset && offset < bytes.length) throw Error('History inspection limit splits UTF-8');
31
+ const content = bytes.subarray(offset, end).toString('utf8');
32
+ return { auditSha256, answer: reference, offset, bytes: end - offset, sha256: hash(content), content, nextOffset: end < bytes.length ? end : null };
33
+ }
34
+
8
35
  // The original remains the authority. Literal aliases require exact retained-object binding.
9
36
  export function productWorkingContext(context, auditSha256, composition) {
10
37
  if (context.request?.worker !== 'product-change') throw Error('Current product context requires a Product Change worker');
@@ -114,7 +141,7 @@ export function productWorkingContext(context, auditSha256, composition) {
114
141
  const index = Number(/^issue\.ownerAnswers\[(\d+)\]\.body$/.exec(reference.source)[1]);
115
142
  copy.issue.ownerAnswers[index].body = `[Whole original answer ${reference.source}; inspect productChange.historyIndex and the read-only audit for exact SHA-256/UTF-8 bytes. Authoritative decisions remain unread until inspected, not superseded or reviewed.]`;
116
143
  }
117
- if (copy.contract?.rules) copy.contract.rules += ' Whole-answer transport is active: productChange.historyIndex exhaustively indexes original verified answer bodies. Retrieve each relevant body from productChange.audit at its exact source location, verify the audit digest and decoded body SHA-256/UTF-8 byte count, and inspect its decisions before resolving relevant product decisions. All indexed decisions retain their original authority; unread bodies are not reviewed. Report conflicts or unavailable/stale bindings explicitly rather than guessing, summarizing or inferring supersession.';
144
+ if (copy.contract?.rules) copy.contract.rules += ' Whole-answer transport is active: productChange.historyIndex exhaustively indexes original verified answer bodies. Use productcomposition_inspect with the exclusive history argument { binding: productChange.historyIndex.binding, auditSha256: productChange.audit.sha256, answer: one exact historyIndex.answers reference, offset: 0, limit: 1024 }. The service verifies the raw audit digest and current binding on every request. Check each returned auditSha256, answer, offset, content SHA-256 and UTF-8 byte count; follow nextOffset sequentially until null. Concatenate exact decoded chunks, verify the whole body SHA-256/UTF-8 byte count against the index, and inspect its decisions before resolving relevant product decisions. Offsets are UTF-8 bytes, not characters; truncated replies or partial sequences are not complete inspection. Do not rely on a line-limited read of the single-line audit or enable shell/imports to retrieve or verify it. All indexed decisions retain their original authority; unread bodies are not reviewed. Report conflicts or unavailable/stale bindings explicitly rather than guessing, summarizing or inferring supersession.';
118
145
  if (Buffer.byteLength(JSON.stringify(copy)) > 256 * 1024) throw Error(`Product working context exceeds bounds after exact history transport; current issue/instructions must fit without truncation (issue.body sha256=${hash(context.issue?.body ?? '')}); preserve original inputs and request a bounded current payload`);
119
146
  }
120
147
  return copy;