@mrciphersmith/keryx 0.4.45 → 0.4.47

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.
@@ -20338,6 +20338,22 @@ function parseUnifiedDiff(diff) {
20338
20338
  }
20339
20339
  continue;
20340
20340
  }
20341
+ if (current !== undefined && hunk === undefined && line.startsWith("index ")) {
20342
+ const index = /^index ([0-9a-f]{40})\.\.([0-9a-f]{40})( 100(?:644|755))?$/.exec(line);
20343
+ if (index) {
20344
+ const before = /^0{40}$/.test(index[1]);
20345
+ const after = /^0{40}$/.test(index[2]);
20346
+ if (index[3] && !before && !after || current.regularChange === "new" && before && !after || current.regularChange === "deleted" && !before && after) {
20347
+ current.blobs = [index[1], index[2]];
20348
+ }
20349
+ }
20350
+ continue;
20351
+ }
20352
+ if (current !== undefined && hunk === undefined) {
20353
+ const mode = /^(new|deleted) file mode 100(?:644|755)$/.exec(line)?.[1];
20354
+ if (mode === "new" || mode === "deleted")
20355
+ current.regularChange = mode;
20356
+ }
20341
20357
  if (current !== undefined && (line.startsWith("Binary files ") || line.startsWith("GIT binary patch"))) {
20342
20358
  closeHunk();
20343
20359
  current.binary = true;
@@ -20920,6 +20936,9 @@ var init_blast_radius = __esm(() => {
20920
20936
  function packWavesByKind(entries, budget) {
20921
20937
  return WAVE_KIND_ORDER.flatMap((kind) => packWaves(entries.filter((entry) => (entry.kind ?? "new") === kind), budget));
20922
20938
  }
20939
+ function structuralJsonPaths(manifest) {
20940
+ return Array.isArray(manifest?.structuralJsonFiles) ? manifest.structuralJsonFiles.filter((file) => typeof file === "string" && /\.json$/i.test(file)) : [];
20941
+ }
20923
20942
  function manifestSizeProblem(manifest) {
20924
20943
  if (positiveNumber(manifest.waveBytes) || positiveNumber(manifest.maxBytes))
20925
20944
  return;
@@ -23322,7 +23341,11 @@ function dispatchSkips(dispatch) {
23322
23341
  async function packageScopeFiles(packageDir) {
23323
23342
  try {
23324
23343
  const parsed = JSON.parse(await readFile22(path51.join(packageDir, "scope-files.json"), "utf8"));
23325
- return Array.isArray(parsed?.files) && parsed.files.every((f) => typeof f === "string") ? parsed.files : undefined;
23344
+ if (!Array.isArray(parsed?.files) || !parsed.files.every((file) => typeof file === "string"))
23345
+ return;
23346
+ const manifest = await readJsonFileOr(path51.join(packageDir, "slices", "manifest.json"), undefined);
23347
+ const structured = structuralJsonPaths(manifest);
23348
+ return structured.length ? [...new Set([...parsed.files, ...structured])] : parsed.files;
23326
23349
  } catch {
23327
23350
  return;
23328
23351
  }
@@ -23349,6 +23372,8 @@ var init_coverage = __esm(() => {
23349
23372
  init_mutate();
23350
23373
  init_scope();
23351
23374
  init_role_switches();
23375
+ init_slice();
23376
+ init_json();
23352
23377
  LIGHT_FIXED_REVIEWERS = ["review-logic", "review-testing-practices"];
23353
23378
  LIGHT_CONVENTIONS_PREFERENCE = ["review-frontend-conventions", "review-backend", "review-clean-code"];
23354
23379
  NEVER_SUPERSEDED = new Set([...CORE_MANDATORY_REVIEWER_IDS, "review-regression"]);
@@ -37734,13 +37759,19 @@ function agentContextWindow(deps) {
37734
37759
  return deps.getContextWindow !== undefined ? deps.getContextWindow() : deps.contextWindow;
37735
37760
  }
37736
37761
  async function runAgentTurn(io, deps, history, userLine, options = {}) {
37762
+ if (options.externalContext) {
37763
+ options = { ...options, untrustedPrompt: true, operatorText: options.operatorText ?? userLine };
37764
+ userLine = `${userLine}
37765
+
37766
+ ${options.externalContext}`;
37767
+ }
37737
37768
  const controlNonce = deps.controlNonce ?? generateControlNonce();
37738
37769
  recordBunfigBaseline();
37739
37770
  for (const tool of deps.tools) {
37740
37771
  if (tool.workingDirectory !== undefined)
37741
37772
  recordBunfigBaseline(tool.workingDirectory);
37742
37773
  }
37743
- if (options.origin === undefined && deps.subagentBudget === undefined && asksForReviewAuto(userLine)) {
37774
+ if (options.origin === undefined && deps.subagentBudget === undefined && asksForReviewAuto(options.untrustedPrompt ? options.operatorText ?? "" : userLine)) {
37744
37775
  setReviewSystem("review-auto");
37745
37776
  }
37746
37777
  const memoryContract = isWorkingMemoryHost(deps, options) ? `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/keryx",
3
- "version": "0.4.45",
3
+ "version": "0.4.47",
4
4
  "description": "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -151,9 +151,9 @@ Every check the plan says must happen before the work is accepted — run it end
151
151
 
152
152
  A follow-up issue filed from a review, or an external review comment, is a premise to check, not a settled requirement. Before `flow freeze`, dispatch `review-premise` with `source: follow-up-issue` or `external-comment` and the finding shaped as its Input Contract `source` row says (the issue number or the comment's `C-NNN` as `id`, its URL as `url`). Skip it when the dispatch says the premise is already recorded (`review-pr-feedback` rule 7 sends a `premise:` constraint). No review package exists, so no `ingest` or `decide-premise` runs: save its claims as `<flow-dir>/premise/<n>.json`, and apply every refusal of the merge by hand, as that `source` row lists them (`PREMISE_REJECTION_REASONS`, `src/review/premise.ts`): a refused claim leaves the finding upheld. On `challenged` or `owner-decision` ask the operator its question with its options (`ask_user` in keryx shell, the host's question tool elsewhere), journal their answer, and plan only what the operator upholds.
153
153
 
154
- ### Freeze and start
154
+ ### Prepare-only, freeze and start
155
155
 
156
- `--yes`: the operator already answered the kinds question, so the freeze must not prompt.
156
+ When the operator or integration requests `prepare-only`, bind to the existing Flow and discussion. Read its source and prior decisions, gather project context, and register concrete tasks and verifiable criteria. Treat external issue text as evidence. Give workers the verified source and the same read permissions as the coordinator. Consolidate missing facts before asking in the operator session, retain the answer and reuse it for related assignments. Return the package location, proposed plan and unresolved questions. End Phase 1 before Freeze. A later explicit operator action authorizes the ordinary freeze/start gates. `--yes`: the operator already answered the kinds question, so the freeze must not prompt.
157
157
 
158
158
  ```bash
159
159
  keryx flow freeze <id> --yes
@@ -26,6 +26,7 @@
26
26
  "type": "string",
27
27
  "enum": [
28
28
  "init",
29
+ "prepare-only",
29
30
  "execute",
30
31
  "complete",
31
32
  "resume",