@hexagen-monaco/sync 0.12.0 → 0.13.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 (99) hide show
  1. package/README.md +429 -0
  2. package/dist/cli.js +6253 -439
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/arch/edit.d.ts.map +1 -1
  5. package/dist/commands/contract/evaluate.d.ts +45 -0
  6. package/dist/commands/contract/evaluate.d.ts.map +1 -0
  7. package/dist/commands/contract/index.d.ts +24 -0
  8. package/dist/commands/contract/index.d.ts.map +1 -0
  9. package/dist/commands/evidence/check.d.ts +31 -0
  10. package/dist/commands/evidence/check.d.ts.map +1 -0
  11. package/dist/commands/evidence/index.d.ts +3 -0
  12. package/dist/commands/evidence/index.d.ts.map +1 -0
  13. package/dist/commands/evidence/pack.d.ts +41 -0
  14. package/dist/commands/evidence/pack.d.ts.map +1 -0
  15. package/dist/commands/grant/build.d.ts +53 -0
  16. package/dist/commands/grant/build.d.ts.map +1 -0
  17. package/dist/commands/grant/canonical.d.ts +27 -0
  18. package/dist/commands/grant/canonical.d.ts.map +1 -0
  19. package/dist/commands/grant/check.d.ts +26 -0
  20. package/dist/commands/grant/check.d.ts.map +1 -0
  21. package/dist/commands/grant/duration.d.ts +8 -0
  22. package/dist/commands/grant/duration.d.ts.map +1 -0
  23. package/dist/commands/grant/index.d.ts +2 -0
  24. package/dist/commands/grant/index.d.ts.map +1 -0
  25. package/dist/commands/grant/issue.d.ts +23 -0
  26. package/dist/commands/grant/issue.d.ts.map +1 -0
  27. package/dist/commands/grant/key-init.d.ts +16 -0
  28. package/dist/commands/grant/key-init.d.ts.map +1 -0
  29. package/dist/commands/grant/revoke.d.ts +35 -0
  30. package/dist/commands/grant/revoke.d.ts.map +1 -0
  31. package/dist/commands/grant/show.d.ts +18 -0
  32. package/dist/commands/grant/show.d.ts.map +1 -0
  33. package/dist/commands/grant/sign.d.ts +3 -0
  34. package/dist/commands/grant/sign.d.ts.map +1 -0
  35. package/dist/commands/grant/signing-key.d.ts +22 -0
  36. package/dist/commands/grant/signing-key.d.ts.map +1 -0
  37. package/dist/commands/grant/verify.d.ts +45 -0
  38. package/dist/commands/grant/verify.d.ts.map +1 -0
  39. package/dist/commands/grant/workspace.d.ts +11 -0
  40. package/dist/commands/grant/workspace.d.ts.map +1 -0
  41. package/dist/commands/observe/imports/jsonc.d.ts +6 -0
  42. package/dist/commands/observe/imports/jsonc.d.ts.map +1 -0
  43. package/dist/commands/observe/imports/pass.d.ts +45 -0
  44. package/dist/commands/observe/imports/pass.d.ts.map +1 -0
  45. package/dist/commands/observe/imports/resolve.d.ts +44 -0
  46. package/dist/commands/observe/imports/resolve.d.ts.map +1 -0
  47. package/dist/commands/observe/imports/safe-read.d.ts +30 -0
  48. package/dist/commands/observe/imports/safe-read.d.ts.map +1 -0
  49. package/dist/commands/observe/imports/scan.d.ts +59 -0
  50. package/dist/commands/observe/imports/scan.d.ts.map +1 -0
  51. package/dist/commands/observe/index.d.ts +59 -0
  52. package/dist/commands/observe/index.d.ts.map +1 -0
  53. package/dist/commands/observe/same-path.d.ts +9 -0
  54. package/dist/commands/observe/same-path.d.ts.map +1 -0
  55. package/dist/commands/observe/walk.d.ts +29 -0
  56. package/dist/commands/observe/walk.d.ts.map +1 -0
  57. package/dist/commands/shared/brownfield-sidecar.d.ts +68 -0
  58. package/dist/commands/shared/brownfield-sidecar.d.ts.map +1 -0
  59. package/dist/commands/shared/git-exclude.d.ts +36 -0
  60. package/dist/commands/shared/git-exclude.d.ts.map +1 -0
  61. package/dist/commands/shared/glob.d.ts +29 -0
  62. package/dist/commands/shared/glob.d.ts.map +1 -0
  63. package/dist/commands/shared/ignore.d.ts +32 -0
  64. package/dist/commands/shared/ignore.d.ts.map +1 -0
  65. package/dist/commands/shared/sidecar-out.d.ts +6 -0
  66. package/dist/commands/shared/sidecar-out.d.ts.map +1 -0
  67. package/dist/commands/shared/sidecar-write.d.ts +2 -0
  68. package/dist/commands/shared/sidecar-write.d.ts.map +1 -0
  69. package/dist/commands/slice/index.d.ts +23 -0
  70. package/dist/commands/slice/index.d.ts.map +1 -0
  71. package/dist/commands/workbook/allow-list.d.ts +27 -0
  72. package/dist/commands/workbook/allow-list.d.ts.map +1 -0
  73. package/dist/commands/workbook/export.d.ts +41 -0
  74. package/dist/commands/workbook/export.d.ts.map +1 -0
  75. package/dist/commands/workbook/index.d.ts +3 -0
  76. package/dist/commands/workbook/index.d.ts.map +1 -0
  77. package/dist/commands/workbook/zip-read.d.ts +7 -0
  78. package/dist/commands/workbook/zip-read.d.ts.map +1 -0
  79. package/dist/fs-utils.d.ts.map +1 -1
  80. package/dist/generators/barrels/recursive.d.ts.map +1 -1
  81. package/dist/generators/root-file-templates.d.ts +5 -4
  82. package/dist/generators/root-file-templates.d.ts.map +1 -1
  83. package/dist/generators/root-files.d.ts.map +1 -1
  84. package/dist/index.js +355 -75
  85. package/dist/index.js.map +1 -1
  86. package/dist/templates/agents-md/findings/0001-session-log-grows-unbounded.md +35 -0
  87. package/dist/templates/ci-github-actions/findings/0001-ci-runners-have-no-zsh.md +34 -0
  88. package/dist/templates/orchestration/README.md +88 -0
  89. package/dist/templates/orchestration/files/.agents/skills/orchestrate-wave/SKILL.md +511 -0
  90. package/dist/templates/orchestration/files/.agents/skills/orchestrate-wave/references/briefs.md +178 -0
  91. package/dist/templates/orchestration/files/.agents/skills/orchestrate-wave/references/rationale.md +520 -0
  92. package/dist/templates/orchestration/files/.agents/skills/orchestrate-wave/scripts/wave-event.sh +17 -0
  93. package/dist/templates/orchestration/files/.github/workflows/gate.yml +66 -0
  94. package/dist/templates/orchestration/findings/0001-relative-runbook-links-escape-the-skill.md +48 -0
  95. package/dist/templates/orchestration/findings/0002-interpolation-hazard-in-graphql-line.md +46 -0
  96. package/dist/templates/orchestration/manifest.json +41 -0
  97. package/dist/types/manifest/monorepo.d.ts +4 -0
  98. package/dist/types/manifest/monorepo.d.ts.map +1 -1
  99. package/package.json +1 -1
@@ -0,0 +1,35 @@
1
+ ---
2
+ id: 0001
3
+ subject: agents-md
4
+ subjectKind: template
5
+ subjectVersion: "1.0.0"
6
+ fixedIn: null
7
+ class: unbounded-growth
8
+ severity: high
9
+ surface: dx
10
+ status: open
11
+ ---
12
+
13
+ ## What happens
14
+
15
+ The `AGENTS.md` this template emits instructs agents to append session notes
16
+ to `.agents/session-log.md`. The instructions give the file no rotation, no
17
+ size bound and no cursor: every session appends, and any agent told to consult
18
+ it pays the whole file as input. Growth is unbounded, and the cost is paid on
19
+ every read — the artifact meant to make agents faster slowly makes every
20
+ subsequent agent slower.
21
+
22
+ ## Minimal repro
23
+
24
+ A project that has run the template's workflow N times re-reads
25
+ `.agents/session-log.md` before acting: its size, and the tokens an agent
26
+ spends on it, grow at every append with no boundary anywhere in the template's
27
+ instructions.
28
+
29
+ ## Fix
30
+
31
+ Bound the log in the template's instructions: define a maximum size (or a
32
+ session window); when it is exceeded, rotate `.agents/session-log.md` to a
33
+ dated archive the log itself names and start a fresh page that references the
34
+ archive. Appends are unbounded no more: the file a working agent must read
35
+ stays small, and everything older is opt-in.
@@ -0,0 +1,34 @@
1
+ ---
2
+ id: 0001
3
+ subject: ci-github-actions
4
+ subjectKind: template
5
+ subjectVersion: "1.0.0"
6
+ fixedIn: null
7
+ class: host-assumption
8
+ severity: high
9
+ surface: ci
10
+ status: open
11
+ ---
12
+
13
+ ## What happens
14
+
15
+ The CI workflow this template emits runs the project's test suite on a stock
16
+ GitHub Actions runner. The runner image ships `bash` and `sh` but no `zsh`.
17
+ A test suite that spawns `zsh` — shell-integration fixtures, scripts run
18
+ through the author's interactive shell, `zsh -c` steps — passes on a macOS
19
+ developer machine and fails in CI with an ENOENT from the spawn. The template
20
+ gave no warning that the environment it provisions lacks the shell the project
21
+ may assume.
22
+
23
+ ## Minimal repro
24
+
25
+ Any test that executes the host shell, e.g. `zsh -c "echo ok"`, in a suite run
26
+ by the emitted workflow on a stock `ubuntu-latest` runner: green on macOS,
27
+ red in CI.
28
+
29
+ ## Fix
30
+
31
+ Keep the emitted workflow POSIX-neutral and record the assumption: run steps
32
+ must not name `zsh`, and the checklist gains a line telling the author that
33
+ stock runners ship no zsh — a test that needs one owns a skip guard
34
+ (`skipIf(!hasZsh)`) rather than a CI workaround.
@@ -0,0 +1,88 @@
1
+ # Orchestration (`orchestration`)
2
+
3
+ > Delegated wave orchestration: the `orchestrate-wave` skill and a `gate.yml` that runs the one
4
+ > gate your own config declares.
5
+
6
+ | | |
7
+ | ------------- | ------------------------------------------ |
8
+ | **ID** | `orchestration` |
9
+ | **Category** | Tooling |
10
+ | **Provides** | `platform.orchestration` |
11
+ | **Requires** | — |
12
+ | **Conflicts** | none |
13
+ | **Branch** | `feature/generator-template-orchestration` |
14
+
15
+ Author/agent-facing reference, beside `manifest.json` — not emitted into projects. It is the
16
+ template root, not `files/`, exactly like `ci-github-actions`'s: `README.md` and `findings/` are
17
+ documentation about the template, and an output is a file a consumer project receives.
18
+
19
+ ## What it does
20
+
21
+ Installs the `orchestrate-wave` skill — the operating contract for running one wave of a plan
22
+ across per-lane worktrees — and a `gate.yml` whose single CI step is `hexagen-orchestration-gate`.
23
+
24
+ ## What it scaffolds
25
+
26
+ | Output | What it is |
27
+ | --------------------------------------------------------- | ------------------------------------------------------------- |
28
+ | `.github/workflows/gate.yml` | one job, one step: the gate bin |
29
+ | `.agents/skills/orchestrate-wave/SKILL.md` | the operating contract |
30
+ | `.agents/skills/orchestrate-wave/references/rationale.md` | why each rule is what it is |
31
+ | `.agents/skills/orchestrate-wave/references/briefs.md` | prompt templates A–D (lane brief, reviewer, fix brief, sweep) |
32
+ | `.agents/skills/orchestrate-wave/scripts/wave-event.sh` | appends one JSON event line per stage transition |
33
+
34
+ ## The overlay, and why it is not an output
35
+
36
+ `.agents/orchestration/` — `config.yaml`, `house-rules.md`, `cast.md`, `lessons.md`,
37
+ `rationale.local.md` — is **yours**. It is never declared in `outputs`, so `hexagen add` never
38
+ writes it, never hashes it, and never conflict-copies it, and no version bump can touch it.
39
+ `hexagen-orchestration-init` scaffolds it once and skips whatever already exists; run
40
+ `hexagen-orchestration-doctor` to check the config against the invariants the skill locks.
41
+
42
+ `config.yaml` is also the single source for the gate's step list. `gate.yml` names no steps of its
43
+ own, so CI and a human running `hexagen-orchestration-gate` consult the same file.
44
+
45
+ ## Install
46
+
47
+ `hexagen add orchestration`. Questions:
48
+
49
+ | Question | Options (default) |
50
+ | -------------- | ------------------------------------------------------------------------------------------------------- |
51
+ | `agents_md` | `true` — whether `init` scaffolds the Wave Observability text for you to paste into `AGENTS.md` |
52
+ | `node_version` | `auto` — taken from a recorded `ci-github-actions` answer when there is one, else `22`. Never prompted. |
53
+
54
+ ## Checklist (post-install)
55
+
56
+ 1. `yarn add -D @hexagen-monaco/orchestration`
57
+ 2. Optionally add a `"gate": "hexagen-orchestration-gate"` script to `package.json` by hand, for
58
+ local convenience. Templates cannot write `package.json`, and `gate.yml` does not need it — the
59
+ workflow invokes the bin directly with `--no-install`.
60
+ 3. `npx hexagen-orchestration-init`
61
+ 4. If you answered yes to `agents_md`, paste the Wave Observability section from
62
+ `.agents/orchestration/house-rules.md` into `AGENTS.md`. The section is not a template output:
63
+ the engine has no append capability, and your `AGENTS.md` is never-edit.
64
+ 5. `npx hexagen-orchestration-doctor`
65
+ 6. `mutate` and `verify-manifests` run only when `.agents/orchestration/config.yaml` sets
66
+ `mutate: true`.
67
+
68
+ ## Notes for agents
69
+
70
+ - **`requires` is empty on purpose.** The engine treats `requires` as "apply this too if it is not
71
+ recorded installed", so requiring `ci-github-actions` would silently auto-install it and write a
72
+ first-ever `ci.yml` as a conflict copy against an existing one. If `ci-github-actions` is not
73
+ installed, `doctor` says so; nothing installs it behind your back.
74
+ - **`--immutable` here, not in `ci.yml`.** `gate.yml` lands after `yarn add`, so the lockfile
75
+ exists. `ci-github-actions`'s first run does not have one.
76
+ - **No Turbo cache step.** That belongs to `ci-github-actions`'s own workflow; `gate.yml` has no
77
+ equivalent.
78
+ - **Upgrades.** `hexagen add --force orchestration` re-emits the five outputs above, per file,
79
+ writing a `.hexagen-update.*` conflict copy where you have edited one. It does not touch
80
+ `.agents/orchestration/**`.
81
+ - **The skill is one copy.** The template's `files/` tree is the canonical source. A
82
+ byte-identical mirror at hexagen's own `.agents/skills/orchestrate-wave/`, and the guard test
83
+ that holds it so, are OW6's deliverables; neither exists yet.
84
+
85
+ ## Related
86
+
87
+ Pairs with [`ci-github-actions`](../ci-github-actions), whose `ci.yml` is the default `ciWorkflow`
88
+ that `doctor` checks for (A-32), and [`agents-md`](../agents-md) (`AGENTS.md`, which you paste into by hand).