@sabaiway/agent-workflow-kit 5.11.0 → 5.11.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 (65) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/SKILL.md +1 -1
  3. package/capability.json +1 -1
  4. package/package.json +1 -1
  5. package/references/hooks/gate-approve.mjs +13 -2
  6. package/references/hooks/state-block-guard.mjs +14 -2
  7. package/references/scripts/archive-changelog.mjs +14 -3
  8. package/references/scripts/archive-decisions.mjs +14 -3
  9. package/references/scripts/archive-issues.mjs +14 -3
  10. package/references/scripts/check-docs-size.mjs +14 -3
  11. package/references/scripts/migrate-gates.mjs +13 -2
  12. package/tools/ack-write.mjs +3 -3
  13. package/tools/autonomy-doctor.mjs +2 -3
  14. package/tools/bridge-settings.mjs +2 -3
  15. package/tools/cheap-agents.mjs +3 -3
  16. package/tools/commands.mjs +2 -3
  17. package/tools/commit-guard.mjs +3 -3
  18. package/tools/core-evidence.mjs +2 -3
  19. package/tools/coverage-check.mjs +2 -3
  20. package/tools/delegation.mjs +2 -3
  21. package/tools/detect-backends.mjs +2 -3
  22. package/tools/dispatch-record.mjs +1 -1
  23. package/tools/doc-parity.mjs +2 -3
  24. package/tools/family-registry.mjs +3 -3
  25. package/tools/flow-adoption-mint.mjs +70 -0
  26. package/tools/flow-append.mjs +309 -0
  27. package/tools/flow-chain-state.mjs +91 -0
  28. package/tools/flow-check.mjs +2 -3
  29. package/tools/flow-delta-proof.mjs +307 -0
  30. package/tools/flow-finding-manifest.mjs +70 -0
  31. package/tools/flow-legality.mjs +248 -0
  32. package/tools/flow-record-identity.mjs +115 -0
  33. package/tools/flow-record-shape.mjs +283 -0
  34. package/tools/flow-record.mjs +49 -789
  35. package/tools/flow-store-read.mjs +3 -3
  36. package/tools/flow-store.mjs +35 -812
  37. package/tools/flow-subset-budget.mjs +81 -0
  38. package/tools/flow-vocabulary.mjs +96 -0
  39. package/tools/flow-writer.mjs +3 -3
  40. package/tools/gate-hook.mjs +3 -3
  41. package/tools/gates-init.mjs +3 -3
  42. package/tools/grounding.mjs +2 -3
  43. package/tools/hide-footprint.mjs +2 -3
  44. package/tools/inject-methodology.mjs +2 -3
  45. package/tools/lens-region.mjs +2 -3
  46. package/tools/manifest/validate.mjs +2 -3
  47. package/tools/migrate-adr-store.mjs +3 -3
  48. package/tools/path-inventory.mjs +2 -3
  49. package/tools/procedures.mjs +3 -3
  50. package/tools/receipt-deadline.mjs +2 -3
  51. package/tools/recipes.mjs +2 -3
  52. package/tools/recommendations.mjs +3 -3
  53. package/tools/release-scan.mjs +2 -3
  54. package/tools/repo-search.mjs +2 -3
  55. package/tools/review-state.mjs +3 -3
  56. package/tools/run-gates.mjs +2 -3
  57. package/tools/sandbox-masks.mjs +3 -3
  58. package/tools/set-autonomy.mjs +2 -3
  59. package/tools/set-flow.mjs +3 -3
  60. package/tools/set-recipe.mjs +2 -3
  61. package/tools/setup-backends.mjs +3 -3
  62. package/tools/store-append.mjs +2 -2
  63. package/tools/uninstall.mjs +2 -3
  64. package/tools/velocity-profile.mjs +3 -3
  65. package/tools/worktrees.mjs +3 -3
@@ -23,8 +23,8 @@
23
23
 
24
24
  import { readFileSync, lstatSync } from 'node:fs';
25
25
  import { homedir } from 'node:os';
26
- import { pathToFileURL } from 'node:url';
27
26
  import { detectBackends } from './detect-backends.mjs';
27
+ import { isDirectRun } from './direct-run.mjs';
28
28
  import { resolveActivityRecipe, composeActiveRecipeLine } from './recipes.mjs';
29
29
  import { loadAutonomy, resolveAutonomy } from './autonomy-config.mjs';
30
30
  import {
@@ -230,8 +230,7 @@ export const main = (argv, ctx = {}) => {
230
230
  }
231
231
  };
232
232
 
233
- const isDirectRun = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
234
- if (isDirectRun) {
233
+ if (isDirectRun(import.meta.url)) {
235
234
  const r = main(process.argv.slice(2));
236
235
  if (r.stdout) console.log(r.stdout);
237
236
  if (r.stderr) console.error(r.stderr);
@@ -28,9 +28,10 @@ import {
28
28
  chmodSync, readFileSync, realpathSync,
29
29
  } from 'node:fs';
30
30
  import { join, resolve, relative, dirname, isAbsolute } from 'node:path';
31
- import { fileURLToPath, pathToFileURL } from 'node:url';
31
+ import { fileURLToPath } from 'node:url';
32
32
  import os from 'node:os';
33
33
  import { KNOWN_BACKENDS, detectBackend, detectBackends, resolveDir, guideFor, READY } from './detect-backends.mjs';
34
+ import { isDirectRun } from './direct-run.mjs';
34
35
  import { copyTreeRefresh, linkManaged, isReadonlyWriteBoundary } from './fs-safe.mjs';
35
36
  import {
36
37
  READONLY_RERUN_HINT, WRAPPER_MODE, scanBundleOwnedDrift, scanWrapperParity, parityVerdict,
@@ -821,5 +822,4 @@ export const main = (argv = process.argv.slice(2), deps = {}) => {
821
822
  return worst;
822
823
  };
823
824
 
824
- const isDirectRun = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
825
- if (isDirectRun) process.exit(main(process.argv.slice(2)));
825
+ if (isDirectRun(import.meta.url)) process.exit(main(process.argv.slice(2)));
@@ -1,6 +1,6 @@
1
1
  // store-append.mjs — the PARAMETERIZED lock/CAS serialized-append leaf (delegation Plan 1, Phase 2,
2
- // D12). Extracted VERBATIM from flow-store.mjs, which is now its first caller; the delegation store
3
- // (dispatch-store.mjs) is the second. No CLI, no side effects on import.
2
+ // D12). Extracted VERBATIM from the flow store, whose write door flow-append.mjs is now its first
3
+ // caller; the delegation store (dispatch-store.mjs) is the second. No CLI, no side effects on import.
4
4
  //
5
5
  // Why a leaf rather than an import of the flow appender: `appendFlowRecordWithPreflight` hardwires
6
6
  // the AW_FLOW_STORE seam and validateFlowRecord, so a second store could only reuse it by pretending
@@ -24,8 +24,8 @@
24
24
 
25
25
  import { existsSync, statSync, lstatSync, readlinkSync, readFileSync, readdirSync, realpathSync } from 'node:fs';
26
26
  import { join, resolve, dirname, basename, isAbsolute } from 'node:path';
27
- import { pathToFileURL } from 'node:url';
28
27
  import os from 'node:os';
28
+ import { isDirectRun } from './direct-run.mjs';
29
29
  import { surveyFamily, surveyProject, FAMILY_MEMBERS, classifyMember, OK } from './family-registry.mjs';
30
30
  import { removeTreeManaged, unlinkManaged, MANAGED_LINK_CONFLICT } from './fs-safe.mjs';
31
31
  import { deriveLinks } from './setup-backends.mjs';
@@ -606,8 +606,7 @@ const main = (argv) => {
606
606
  }
607
607
  };
608
608
 
609
- const isDirectRun = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
610
- if (isDirectRun) {
609
+ if (isDirectRun(import.meta.url)) {
611
610
  try {
612
611
  main(process.argv.slice(2));
613
612
  } catch (err) {
@@ -1,7 +1,7 @@
1
1
  import { existsSync, lstatSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
2
2
  import { basename, dirname, join, relative, resolve } from 'node:path';
3
3
  import { homedir, tmpdir } from 'node:os';
4
- import { fileURLToPath, pathToFileURL } from 'node:url';
4
+ import { fileURLToPath } from 'node:url';
5
5
  // The --autonomy render reads the per-project autonomy policy through the read-only autonomy core
6
6
  // (AD-044). This file is the family's one .claude/settings.json writer, so the policy render lives here;
7
7
  // it never imports the policy fs-writer (autonomy-write.mjs) — the render owns the settings file, not
@@ -10,6 +10,7 @@ import { AUTONOMY_REL, loadAutonomy, resolveAutonomy, COMMAND_REDLINES } from '.
10
10
  // The bridge-wrappers tier's placement probe (AD-044 Plan 4, Decision 2): a tier entry derives ONLY
11
11
  // for a PLACED bridge wrapper — findOnPath is the same read-only PATH scan the backend detector uses.
12
12
  import { findOnPath } from './detect-backends.mjs';
13
+ import { isDirectRun } from './direct-run.mjs';
13
14
  import { compareSemver } from './semver-lite.mjs';
14
15
  // The declared-path resolution + segment containment the allowWrite degrade shares with the
15
16
  // advisor's worktrees-dir convergence lane — ONE leaf, so the two readings cannot drift.
@@ -1820,5 +1821,4 @@ export const main = (argv = process.argv.slice(2), deps = {}) => {
1820
1821
  }
1821
1822
  };
1822
1823
 
1823
- export const isDirectRun = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
1824
- if (isDirectRun) process.exit(main(process.argv.slice(2)));
1824
+ if (isDirectRun(import.meta.url)) process.exit(main(process.argv.slice(2)));
@@ -13,13 +13,14 @@ import {
13
13
  closeSync, constants as fsC,
14
14
  } from 'node:fs';
15
15
  import { join, dirname, basename, resolve, relative, isAbsolute, sep } from 'node:path';
16
- import { pathToFileURL, fileURLToPath } from 'node:url';
16
+ import { fileURLToPath } from 'node:url';
17
17
  import { spawnSync } from 'node:child_process';
18
18
  import { randomBytes } from 'node:crypto';
19
19
  import {
20
20
  KIT_OWN_PATHS, KNOWN_FOOTPRINT, expandGlob, normalizeSlashes, isDirPattern, isGlobPattern,
21
21
  patternToProbe,
22
22
  } from './known-footprint.mjs';
23
+ import { isDirectRun } from './direct-run.mjs';
23
24
  import { isScratchPlanName, plansInFlight, PLANS_REL, shellQuoteArg } from './review-state.mjs';
24
25
  import { writeContainedFileAtomic } from './atomic-write.mjs';
25
26
  import { assertContainedRealPath } from './fs-safe.mjs';
@@ -3266,5 +3267,4 @@ export const runCli = (argv, deps = {}) => {
3266
3267
  }
3267
3268
  };
3268
3269
 
3269
- const isDirectRun = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
3270
- if (isDirectRun) process.exitCode = runCli(process.argv.slice(2));
3270
+ if (isDirectRun(import.meta.url)) process.exitCode = runCli(process.argv.slice(2));