@mrciphersmith/keryx 0.2.131 → 0.2.133

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/dist/cli.js CHANGED
@@ -22216,8 +22216,12 @@ import { existsSync as existsSync14 } from "fs";
22216
22216
  import path89 from "path";
22217
22217
  async function gdgraphCommand(args) {
22218
22218
  if (process.env.KERYX_GDGRAPH_LOCAL !== "1") {
22219
- const delegated = await delegateToLocalRunner(args);
22220
- if (delegated) {
22219
+ const delegation = await delegateToLocalRunner(args);
22220
+ if (delegation.delegated) {
22221
+ if (args[0] === "build" && delegation.exitCode === 0) {
22222
+ await Promise.resolve().then(() => init_provenance());
22223
+ await recordProvenance(process.cwd(), "gdgraph", new Date().toISOString());
22224
+ }
22221
22225
  return;
22222
22226
  }
22223
22227
  }
@@ -22825,15 +22829,15 @@ async function changedFiles() {
22825
22829
  async function delegateToLocalRunner(args) {
22826
22830
  const localRunner = path89.join(process.cwd(), ".metaproject", "core", "gdgraph", "cli.ts");
22827
22831
  if (!existsSync14(localRunner)) {
22828
- return false;
22832
+ return { delegated: false };
22829
22833
  }
22830
22834
  const command = args[0];
22831
22835
  const treesitterOn = command === "build" && await isCapabilityEnabled(process.cwd(), "gdgraph.treesitter");
22832
22836
  const delegatable = command === "build" && !treesitterOn || command === "query" && !args.includes("--json") && (args[1] === "cycles" || args[1] === "orphans");
22833
22837
  if (!delegatable) {
22834
- return false;
22838
+ return { delegated: false };
22835
22839
  }
22836
- await new Promise((resolve, reject) => {
22840
+ const exitCode = await new Promise((resolve, reject) => {
22837
22841
  const child = spawn4(process.execPath, [localRunner, ...args], {
22838
22842
  cwd: process.cwd(),
22839
22843
  stdio: "inherit",
@@ -22844,11 +22848,11 @@ async function delegateToLocalRunner(args) {
22844
22848
  });
22845
22849
  child.on("error", reject);
22846
22850
  child.on("close", (code) => {
22847
- process.exitCode = code ?? 1;
22848
- resolve();
22851
+ resolve(code ?? 1);
22849
22852
  });
22850
22853
  });
22851
- return true;
22854
+ process.exitCode = exitCode;
22855
+ return { delegated: true, exitCode };
22852
22856
  }
22853
22857
  function printHelp3() {
22854
22858
  console.log(`keryx gdgraph
@@ -51129,7 +51133,7 @@ import path47 from "path";
51129
51133
  // package.json
51130
51134
  var package_default = {
51131
51135
  name: "@mrciphersmith/keryx",
51132
- version: "0.2.131",
51136
+ version: "0.2.133",
51133
51137
  description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
51134
51138
  private: false,
51135
51139
  publishConfig: {
@@ -59098,7 +59102,7 @@ init_provenance();
59098
59102
 
59099
59103
  // src/sync/diff.ts
59100
59104
  init_provenance();
59101
- var CODE_EXT2 = /\.(ts|tsx|js|jsx|mjs|cjs|py|go|rs|java|rb|php|c|h|cc|cpp|hpp|cs|swift|kt|scala|sh|vue|svelte)$/;
59105
+ var CODE_EXT2 = /\.(ts|tsx|mts|cts|js|jsx|mjs|cjs|py|go|rs|java|rb|php|c|h|cc|cpp|hpp|cs|swift|kt|scala|sh|vue|svelte)$/;
59102
59106
  function isCodeFile(file) {
59103
59107
  return CODE_EXT2.test(file);
59104
59108
  }
@@ -59220,7 +59224,22 @@ On git pull / branch switch, they run 'keryx sync' (advisory report). Run 'keryx
59220
59224
  }
59221
59225
  const code = codeOnly(diff);
59222
59226
  if (totalChanges(code) === 0) {
59223
- console.log(` up to date (built at ${provenance.commit.slice(0, 8)})`);
59227
+ if (apply && provenance.commit !== head.commit) {
59228
+ if (module === "gdwiki") {
59229
+ const gate = await resolveWikiSourceGate(cwd, HEAD_NOT_REQUESTED);
59230
+ if (gate.status !== "fresh") {
59231
+ printApplyOutcome({ recorded: false, gate }, "", ` up to date (built at ${provenance.commit.slice(0, 8)}); HEAD moved to ${head.commit.slice(0, 8)} with no code changes, but provenance NOT advanced`);
59232
+ console.log("");
59233
+ continue;
59234
+ }
59235
+ }
59236
+ await recordProvenance(cwd, module, at);
59237
+ console.log(` up to date (built at ${provenance.commit.slice(0, 8)}); no code changed \u2014 provenance advanced to ${head.commit.slice(0, 8)}`);
59238
+ } else if (provenance.commit !== head.commit) {
59239
+ console.log(` up to date (built at ${provenance.commit.slice(0, 8)}); HEAD moved to ${head.commit.slice(0, 8)} with no code changes \u2014 run \`keryx sync --apply\` to advance provenance`);
59240
+ } else {
59241
+ console.log(` up to date (built at ${provenance.commit.slice(0, 8)})`);
59242
+ }
59224
59243
  console.log("");
59225
59244
  continue;
59226
59245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/keryx",
3
- "version": "0.2.131",
3
+ "version": "0.2.133",
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": {
@@ -128,6 +128,27 @@ export async function checkGraphStaleness(cwd: string): Promise<StalenessCheck>
128
128
  let gitFailed = false;
129
129
 
130
130
  // --- new commit -----------------------------------------------------------
131
+ //
132
+ // Flow 280 (the graph-provenance stall): this comparison is intentionally a
133
+ // bare commit-hash check, and it stays one. The disagreement that flow
134
+ // fixed — a `.metaproject/`-only commit left `keryx sync` saying "nothing
135
+ // to rebuild" while THIS check said "stale" forever, because nothing ever
136
+ // advanced the provenance commit this reads — was not a defect in this
137
+ // comparison. `checkGraphStaleness` has no notion of "since provenance was
138
+ // last recorded" and no per-commit diff to reason from; it only ever sees
139
+ // the two endpoints (`provenance.commit`, `head.commit`). Rederiving "did
140
+ // any code file change between them" here would mean re-running the same
141
+ // diff `../sync/diff.ts` already computes, in a module whose contract is a
142
+ // cheap, dependency-light freshness probe (staleness.test.ts, AFC-10) —
143
+ // and would leave that diff computed twice, once here and once in sync's
144
+ // own loop, with the two free to drift. The fix instead makes the ONE place
145
+ // that already has the diff (`../commands/sync.ts`'s per-module loop)
146
+ // advance provenance to HEAD when that diff is empty, so this check's
147
+ // simple "did the commit move" question starts answering "no" again — which
148
+ // is also why it is correct for this to stay a hard equality check: once
149
+ // provenance is honestly advanced, an ADVANCING mismatch here really does
150
+ // mean the graph predates HEAD, and this is exactly the check the wiki gate
151
+ // (`../wiki/staleness.ts`) needs to keep trusting for that.
131
152
  const head = await gitHead(cwd);
132
153
  if (head === null) {
133
154
  gitFailed = true;