agentic-workflow-manager 9.18.0 → 9.20.0

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 (69) hide show
  1. package/dist/src/commands/change/index.js +492 -0
  2. package/dist/src/commands/changes/index.js +84 -0
  3. package/dist/src/commands/plan/index.js +1 -1
  4. package/dist/src/commands/sensors/index.js +9 -0
  5. package/dist/src/commands/sensors/read-only-observation.js +305 -0
  6. package/dist/src/commands/sensors/run.js +24 -60
  7. package/dist/src/core/admission/index.js +11 -1
  8. package/dist/src/core/changes/command.js +38 -0
  9. package/dist/src/core/changes/derive.js +120 -0
  10. package/dist/src/core/changes/fs-safe.js +47 -0
  11. package/dist/src/core/changes/git-env.js +68 -0
  12. package/dist/src/core/changes/git.js +216 -0
  13. package/dist/src/core/changes/list-parse.js +67 -0
  14. package/dist/src/core/changes/list.js +408 -0
  15. package/dist/src/core/changes/parse.js +72 -0
  16. package/dist/src/core/changes/range.js +53 -0
  17. package/dist/src/core/changes/receipt.js +274 -0
  18. package/dist/src/core/changes/record-io.js +149 -0
  19. package/dist/src/core/changes/render-list.js +109 -0
  20. package/dist/src/core/changes/render.js +178 -0
  21. package/dist/src/core/changes/text-safety.js +116 -0
  22. package/dist/src/core/changes/trailers.js +76 -0
  23. package/dist/src/core/changes/types.js +26 -0
  24. package/dist/src/core/changes/validate-shape.js +219 -0
  25. package/dist/src/core/changes/worktree.js +53 -0
  26. package/dist/src/core/currentness/check.js +5 -2
  27. package/dist/src/index.js +4 -0
  28. package/dist/src/release/orchestrator.js +3 -1
  29. package/dist/tests/commands/change/new.test.js +1126 -0
  30. package/dist/tests/commands/change/validate.test.js +1145 -0
  31. package/dist/tests/commands/changes/list.test.js +423 -0
  32. package/dist/tests/commands/sensors/index.test.js +1 -1
  33. package/dist/tests/commands/sensors/read-only-observation.test.js +537 -0
  34. package/dist/tests/commands/sensors/run-read-only.test.js +151 -0
  35. package/dist/tests/core/admission/index.test.js +60 -0
  36. package/dist/tests/core/changes/derive.test.js +455 -0
  37. package/dist/tests/core/changes/fs-safe.test.js +82 -0
  38. package/dist/tests/core/changes/git-env.test.js +143 -0
  39. package/dist/tests/core/changes/git.test.js +442 -0
  40. package/dist/tests/core/changes/helpers.js +269 -0
  41. package/dist/tests/core/changes/list-fixtures.js +122 -0
  42. package/dist/tests/core/changes/list-long-history.test.js +52 -0
  43. package/dist/tests/core/changes/list-paging.test.js +511 -0
  44. package/dist/tests/core/changes/list-parse.test.js +120 -0
  45. package/dist/tests/core/changes/list-tree.test.js +44 -0
  46. package/dist/tests/core/changes/list.test.js +821 -0
  47. package/dist/tests/core/changes/parse.test.js +142 -0
  48. package/dist/tests/core/changes/predicates.test.js +83 -0
  49. package/dist/tests/core/changes/range.test.js +92 -0
  50. package/dist/tests/core/changes/receipt.test.js +947 -0
  51. package/dist/tests/core/changes/record-io.test.js +307 -0
  52. package/dist/tests/core/changes/record.test.js +549 -0
  53. package/dist/tests/core/changes/render-list.test.js +212 -0
  54. package/dist/tests/core/changes/render.test.js +202 -0
  55. package/dist/tests/core/changes/text-safety.test.js +226 -0
  56. package/dist/tests/core/changes/trailers.test.js +181 -0
  57. package/dist/tests/core/changes/worktree.test.js +259 -0
  58. package/dist/tests/core/currentness/check-insteadof.test.js +120 -0
  59. package/dist/tests/core/currentness/check.test.js +75 -14
  60. package/dist/tests/release/orchestrator-trailer.test.js +72 -0
  61. package/dist/tests/release/orchestrator.test.js +1 -0
  62. package/dist/tests/structural/change-commands-are-registered.test.js +29 -0
  63. package/dist/tests/structural/change-record-git-and-platform-conventions.test.js +77 -0
  64. package/dist/tests/structural/cloud-admission-docs-contract.test.js +54 -0
  65. package/package.json +1 -1
  66. package/prebuilds/darwin-arm64/secure_fs.node +0 -0
  67. package/prebuilds/darwin-x64/secure_fs.node +0 -0
  68. package/prebuilds/win32-arm64/secure_fs.node +0 -0
  69. package/prebuilds/win32-x64/secure_fs.node +0 -0
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.REASON_GIT_FAILED = exports.REASON_NOT_REPO = exports.RUNTIME_STATE_EXCLUDES = void 0;
7
+ exports.gitState = gitState;
8
+ const path_1 = __importDefault(require("path"));
9
+ const git_env_1 = require("./git-env");
10
+ const text_safety_1 = require("./text-safety");
11
+ /** Local runtime state that never counts as a working-tree change. Everything else under `.awm/` (e.g. `.awm/sensors.json`) does. */
12
+ exports.RUNTIME_STATE_EXCLUDES = ['.awm/sensors/runs', '.awm/journal', '.awm/ledger', '.awm/evidence', '.awm/track.json'];
13
+ exports.REASON_NOT_REPO = 'not inside a git repository with a commit';
14
+ exports.REASON_GIT_FAILED = 'git command failed or timed out';
15
+ const MAX_EXTRA_EXCLUDES = 64;
16
+ const MAX_GIT_OUTPUT = 64 * 1024 * 1024;
17
+ /** A git that ran and exited non-zero (no repo, no commit) is `not-repo`; one that could not run, timed out or overflowed is `failed`. */
18
+ function gitFailure(error) {
19
+ return typeof error.status === 'number' ? { kind: 'not-repo' } : { kind: 'failed' };
20
+ }
21
+ /**
22
+ * Repository root, HEAD and whether the tree differs from it, excluding RUNTIME_STATE_EXCLUDES.
23
+ * `untracked` selects the pre-run measure (untracked files count, forced past any `status.showUntrackedFiles` config)
24
+ * or the post-run recheck (tracked changes only). `extraExcludes` (default none) are repo-relative paths ignored in addition
25
+ * to RUNTIME_STATE_EXCLUDES; any that is not a safe relative path makes the result `failed`. The root is returned with native
26
+ * separators: git prints forward slashes on Windows. Never throws.
27
+ */
28
+ function gitState(cwd, untracked, extraExcludes = []) {
29
+ if (typeof cwd !== 'string' || cwd.length === 0)
30
+ return { kind: 'failed' };
31
+ if (!Array.isArray(extraExcludes) || extraExcludes.length > MAX_EXTRA_EXCLUDES || !extraExcludes.every(text_safety_1.isSafeRelativePath))
32
+ return { kind: 'failed' };
33
+ let root;
34
+ let commit;
35
+ try {
36
+ root = path_1.default.resolve((0, git_env_1.execGit)(cwd, ['rev-parse', '--show-toplevel'], { stderr: 'ignore' }).trim());
37
+ commit = (0, git_env_1.execGit)(root, ['rev-parse', 'HEAD'], { stderr: 'ignore' }).trim();
38
+ }
39
+ catch (error) {
40
+ return gitFailure(error);
41
+ }
42
+ try {
43
+ // Submodules are never hidden by config (`.gitmodules` ignore=all, diff.ignoreSubmodules). The pre-run measure counts everything
44
+ // (`none`); the post-run recheck is about tracked files only, so it also ignores untracked content inside a submodule
45
+ // (sensor build/coverage output) while still seeing a moved checkout or modified tracked content (`untracked`).
46
+ const args = ['status', '--porcelain', untracked ? '--untracked-files=normal' : '--untracked-files=no', untracked ? '--ignore-submodules=none' : '--ignore-submodules=untracked', '--', '.', ...exports.RUNTIME_STATE_EXCLUDES.map((p) => `:(exclude)${p}`), ...extraExcludes.map((p) => `:(exclude,literal)${p}`)];
47
+ const status = (0, git_env_1.execGit)(root, args, { stderr: 'ignore', maxBuffer: MAX_GIT_OUTPUT });
48
+ return { kind: 'ok', root, commit, dirty: status.trim().length > 0 };
49
+ }
50
+ catch {
51
+ return { kind: 'failed' };
52
+ }
53
+ }
@@ -162,12 +162,15 @@ async function registryComponent(registry, git, prefs, checkedAt) {
162
162
  if (!authorizedSource)
163
163
  return fail('Configured registry remote is not an authoritative HTTPS or SSH source.', 'Configure an authoritative registry remote and rerun strict preflight.');
164
164
  const [originResult, headResult, tagResult, remoteResult] = await Promise.allSettled([
165
- deadline(git(registry.contentRoot, ['remote', 'get-url', 'origin'], { timeoutMs: TIMEOUT_MS, maxOutputBytes: MAX_OUTPUT_BYTES })),
165
+ // The literal stored value of THIS checkout: `git remote get-url` applies url.*.insteadOf, and
166
+ // cloud environments (AWM's own D-7 recipe) rewrite to a token-bearing URL; without
167
+ // `--local`, a global/system `remote.origin.url` could stand in for a missing origin.
168
+ deadline(git(registry.contentRoot, ['config', '--local', '--get', 'remote.origin.url'], { timeoutMs: TIMEOUT_MS, maxOutputBytes: MAX_OUTPUT_BYTES })),
166
169
  deadline(git(registry.contentRoot, ['rev-parse', 'HEAD'], { timeoutMs: TIMEOUT_MS, maxOutputBytes: MAX_OUTPUT_BYTES })),
167
170
  deadline(git(registry.contentRoot, ['describe', '--tags', '--exact-match', 'HEAD'], { timeoutMs: TIMEOUT_MS, maxOutputBytes: MAX_OUTPUT_BYTES })),
168
171
  deadline(git(registry.contentRoot, ['ls-remote', '--tags', registry.remote], { timeoutMs: TIMEOUT_MS, maxOutputBytes: MAX_OUTPUT_BYTES })),
169
172
  ]);
170
- if (originResult.status === 'rejected')
173
+ if (originResult.status === 'rejected' || originResult.value.trim() === '')
171
174
  return fail('Could not read local registry origin.', 'Inspect the local registry checkout and its origin remote.');
172
175
  if (headResult.status === 'rejected')
173
176
  return fail('Could not read local registry HEAD.', 'Inspect or repair the local registry checkout.');
package/dist/src/index.js CHANGED
@@ -45,6 +45,8 @@ const job_1 = require("./commands/job");
45
45
  const watch_1 = require("./commands/watch");
46
46
  const track_1 = require("./commands/track");
47
47
  const evidence_1 = require("./commands/evidence");
48
+ const change_1 = require("./commands/change");
49
+ const changes_1 = require("./commands/changes");
48
50
  const process_1 = require("./commands/process");
49
51
  const context_1 = require("./commands/context");
50
52
  const model_policy_1 = require("./commands/model-policy");
@@ -752,6 +754,8 @@ miroCmd.command('sync <storyMapPath>')
752
754
  (0, watch_1.registerWatchCommand)(exports.program);
753
755
  (0, track_1.registerTrackCommand)(exports.program);
754
756
  (0, evidence_1.registerEvidenceCommand)(exports.program);
757
+ (0, change_1.registerChangeCommand)(exports.program);
758
+ (0, changes_1.registerChangesCommand)(exports.program);
755
759
  (0, process_1.registerProcessCommand)(exports.program);
756
760
  (0, context_1.registerContextCommand)(exports.program);
757
761
  // Commander only waits for async action handlers through parseAsync(). The CLI has
@@ -69,7 +69,9 @@ function release(opts, io) {
69
69
  const section = (0, core_1.renderChangelog)(version, io.today(), commits);
70
70
  io.writeChangelog(section + '\n' + io.readChangelog());
71
71
  io.run('git', ['add', 'cli/package.json', 'cli/package-lock.json', 'CHANGELOG.md']);
72
- io.run('git', ['commit', '-m', `chore(release): v${version} [skip ci]`]);
72
+ // R6.1 (#217): the bump commit carries the Change Record opt-out trailer so
73
+ // `awm changes list` reports it as `exempt`, never as `missing`.
74
+ io.run('git', ['commit', '-m', `chore(release): v${version} [skip ci]`, '-m', 'Change-Record: none']);
73
75
  io.run('git', ['tag', '-a', `v${version}`, '-m', `v${version}`]);
74
76
  // OIDC mode: GitHub inyecta ACTIONS_ID_TOKEN_REQUEST_URL con id-token:write
75
77
  // o NODE_AUTH_TOKEN sin NPM_TOKEN (setup-node legacy con OIDC)