@entelligentsia/forgecli 1.0.2 → 1.0.3

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 (88) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/CHANGELOG-forge-plugin.md +24 -0
  3. package/dist/extensions/forgecli/audience-gate.js +1 -1
  4. package/dist/extensions/forgecli/audience-gate.js.map +1 -1
  5. package/dist/extensions/forgecli/fix-bug.d.ts +1 -2
  6. package/dist/extensions/forgecli/fix-bug.js +678 -609
  7. package/dist/extensions/forgecli/fix-bug.js.map +1 -1
  8. package/dist/extensions/forgecli/forge-artifact-tool.js +15 -3
  9. package/dist/extensions/forgecli/forge-artifact-tool.js.map +1 -1
  10. package/dist/extensions/forgecli/forge-subagent.d.ts +17 -0
  11. package/dist/extensions/forgecli/forge-subagent.js +31 -12
  12. package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
  13. package/dist/extensions/forgecli/forge-tools.d.ts +6 -0
  14. package/dist/extensions/forgecli/forge-tools.js +69 -6
  15. package/dist/extensions/forgecli/forge-tools.js.map +1 -1
  16. package/dist/extensions/forgecli/run-task.js +461 -391
  17. package/dist/extensions/forgecli/run-task.js.map +1 -1
  18. package/dist/extensions/forgecli/session-registry.d.ts +12 -0
  19. package/dist/extensions/forgecli/session-registry.js +23 -0
  20. package/dist/extensions/forgecli/session-registry.js.map +1 -1
  21. package/dist/extensions/forgecli/subagent/caller-context.d.ts +35 -11
  22. package/dist/extensions/forgecli/subagent/caller-context.js +49 -21
  23. package/dist/extensions/forgecli/subagent/caller-context.js.map +1 -1
  24. package/dist/extensions/forgecli/subagent/orchestrator-transcript.d.ts +66 -0
  25. package/dist/extensions/forgecli/subagent/orchestrator-transcript.js +66 -0
  26. package/dist/extensions/forgecli/subagent/orchestrator-transcript.js.map +1 -0
  27. package/dist/extensions/forgecli/subagent/phase-guard.d.ts +34 -0
  28. package/dist/extensions/forgecli/subagent/phase-guard.js +139 -0
  29. package/dist/extensions/forgecli/subagent/phase-guard.js.map +1 -0
  30. package/dist/extensions/forgecli/subagent/phase-summary-map.d.ts +1 -0
  31. package/dist/extensions/forgecli/subagent/phase-summary-map.js +22 -0
  32. package/dist/extensions/forgecli/subagent/phase-summary-map.js.map +1 -0
  33. package/dist/extensions/forgecli/thread-switcher.js +2 -2
  34. package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
  35. package/dist/extensions/forgecli/viewport-events.d.ts +4 -0
  36. package/dist/extensions/forgecli/viewport-events.js +18 -1
  37. package/dist/extensions/forgecli/viewport-events.js.map +1 -1
  38. package/dist/extensions/forgecli/viewport-renderer.d.ts +12 -2
  39. package/dist/extensions/forgecli/viewport-renderer.js +8 -6
  40. package/dist/extensions/forgecli/viewport-renderer.js.map +1 -1
  41. package/dist/forge-payload/.base-pack/workflows/fix_bug.md +10 -28
  42. package/dist/forge-payload/.base-pack/workflows/triage.md +190 -0
  43. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  44. package/dist/forge-payload/.schemas/enum-catalog.json +1 -1
  45. package/dist/forge-payload/.schemas/migrations.json +9 -0
  46. package/dist/forge-payload/integrity.json +3 -3
  47. package/dist/forge-payload/meta/fragments/tool-discipline.md +21 -2
  48. package/dist/forge-payload/meta/workflows/meta-bug-triage.md +210 -0
  49. package/dist/forge-payload/meta/workflows/meta-fix-bug.md +10 -28
  50. package/dist/forge-payload/schemas/enum-catalog.json +1 -1
  51. package/dist/forge-payload/schemas/structure-manifest.json +20 -1
  52. package/dist/forge-payload/tools/artifact.cjs +34 -5
  53. package/node_modules/@entelligentsia/forge-compress/dist/compressor.d.ts +6 -0
  54. package/node_modules/@entelligentsia/forge-compress/dist/compressor.js +137 -0
  55. package/node_modules/@entelligentsia/forge-compress/dist/entropy.d.ts +3 -0
  56. package/node_modules/@entelligentsia/forge-compress/dist/entropy.js +99 -0
  57. package/node_modules/@entelligentsia/forge-compress/dist/forge/entity.d.ts +8 -0
  58. package/node_modules/@entelligentsia/forge-compress/dist/forge/entity.js +149 -0
  59. package/node_modules/@entelligentsia/forge-compress/dist/forge/index.d.ts +7 -0
  60. package/node_modules/@entelligentsia/forge-compress/dist/forge/index.js +4 -0
  61. package/node_modules/@entelligentsia/forge-compress/dist/forge/markdown.d.ts +5 -0
  62. package/node_modules/@entelligentsia/forge-compress/dist/forge/markdown.js +92 -0
  63. package/node_modules/@entelligentsia/forge-compress/dist/forge/query.d.ts +7 -0
  64. package/node_modules/@entelligentsia/forge-compress/dist/forge/query.js +60 -0
  65. package/node_modules/@entelligentsia/forge-compress/dist/forge/validate.d.ts +1 -0
  66. package/node_modules/@entelligentsia/forge-compress/dist/forge/validate.js +82 -0
  67. package/node_modules/@entelligentsia/forge-compress/dist/index.d.ts +6 -0
  68. package/node_modules/@entelligentsia/forge-compress/dist/index.js +5 -0
  69. package/node_modules/@entelligentsia/forge-compress/dist/progressive.d.ts +1 -0
  70. package/node_modules/@entelligentsia/forge-compress/dist/progressive.js +108 -0
  71. package/node_modules/@entelligentsia/forge-compress/dist/strip.d.ts +4 -0
  72. package/node_modules/@entelligentsia/forge-compress/dist/strip.js +55 -0
  73. package/node_modules/@entelligentsia/forge-compress/dist/tokens.d.ts +2 -0
  74. package/node_modules/@entelligentsia/forge-compress/dist/tokens.js +17 -0
  75. package/node_modules/@entelligentsia/forge-compress/package.json +45 -0
  76. package/node_modules/@entelligentsia/forge-compress/src/__tests__/compress.test.ts +409 -0
  77. package/node_modules/@entelligentsia/forge-compress/src/compressor.ts +147 -0
  78. package/node_modules/@entelligentsia/forge-compress/src/entropy.ts +105 -0
  79. package/node_modules/@entelligentsia/forge-compress/src/forge/entity.ts +184 -0
  80. package/node_modules/@entelligentsia/forge-compress/src/forge/index.ts +10 -0
  81. package/node_modules/@entelligentsia/forge-compress/src/forge/markdown.ts +122 -0
  82. package/node_modules/@entelligentsia/forge-compress/src/forge/query.ts +105 -0
  83. package/node_modules/@entelligentsia/forge-compress/src/forge/validate.ts +86 -0
  84. package/node_modules/@entelligentsia/forge-compress/src/index.ts +22 -0
  85. package/node_modules/@entelligentsia/forge-compress/src/progressive.ts +123 -0
  86. package/node_modules/@entelligentsia/forge-compress/src/strip.ts +58 -0
  87. package/node_modules/@entelligentsia/forge-compress/src/tokens.ts +19 -0
  88. package/package.json +5 -10
package/CHANGELOG.md CHANGED
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.0.3] — 2026-05-28
11
+
12
+ ### Fixed
13
+
14
+ - **FORGE-BUG-040 (critical) — `/forge:fix-bug` triage subagent received the orchestrator-only `fix_bug.md` body and executed the full bug lifecycle in one phase.** `BUG_PHASES` wiring corrected: `triage → triage`, `plan-fix → plan_task`, `implement → implement_plan` (previously all three pointed at `fix_bug`). The compensating materialization-skip wrapper and audience-bypass clause are deleted; the audience gate now runs uniformly for every BUG phase. Pairs with plugin v1.0.3 (coordinated release). Closes Entelligentsia/forge#110.
15
+
16
+ ### Added
17
+
18
+ - `subagent/phase-guard.ts` — tool-boundary phase-ownership enforcement (`assertPhaseOwnership`, `assertBugStatusOwnership`, `assertOrchestratorOnlyEmit`, `PhaseOwnershipError`). Wired into `forge_preflight` and the four bug-mutating `forge_store` verbs (`set-bug-summary`, `set-summary`, `update-status bug`, `emit`). Subagent callers attempting cross-phase calls are rejected with a structured error; orchestrator callers are unaffected.
19
+ - `subagent/phase-summary-map.ts` — single-source `BUG_SUMMARY_KEY_BY_ROLE` (hoisted out of `fix-bug.ts` to break a `forge-tools → phase-guard → fix-bug → forge-tools` circular import). `fix-bug.ts` re-exports for backwards compatibility.
20
+ - `@entelligentsia/forge-compress` integration (pre-approved separate work bundled in this release) — `compressWithTelemetry` wraps `forge_store` read/list, `forge_validate_store`, and `forge_store_query` results; `cumCompression` surfaced in phase summaries.
21
+
22
+ ### Changed
23
+
24
+ - `CallerContext` extended from string union to discriminated union: `{ kind: "orchestrator" } | { kind: "subagent"; phase: PhaseRole }`. `CallerContextStore.asSubagent(phase, fn)` requires a `PhaseRole` argument — this is now the single setter of phase context for any subagent dispatch.
25
+ - `fix-bug.ts` and `run-task.ts` phase loops wrap `runForgeSubagent(...)` in `CallerContextStore.asSubagent(phase.role, ...)`. Task-mode pipelines are protected against the same defect class.
26
+ - `composeBugBody` triage hint trimmed — route-field requirement and Path A/B criteria now live natively in `triage.md`.
27
+ - **Per-iteration subagent transcripts (FORGE-BUG-040 follow-up).** The per-subagent transcript filename now carries an ISO-compact timestamp prefix (`<ISO>__<entity>__<phase>.json`) so successive dispatches of the same phase during review loops (`plan → review → plan → review`) all persist instead of overwriting. Directory listings sort chronologically by default. Payload schema gains `startedAt` + `finishedAt` (replacing the prior single `timestamp` field).
28
+
29
+ ### Added (additional)
30
+
31
+ - **Orchestrator transcript (FORGE-BUG-040 follow-up).** New JSONL log per pipeline run capturing `pipeline-start`, `phase-start`, `phase-end`, `phase-loopback`, `pipeline-end` events plus every `ctx.ui.notify` line teed from the orchestrator. Written to `.forge/transcripts/<entity>/<ISO>__<entity>__orchestrator.jsonl`. Wired into both `runBugPipeline` (`fix-bug.ts`) and `runTaskPipeline` (`run-task.ts`) with a `try/finally` so the notify wrapper is always restored. New module: `subagent/orchestrator-transcript.ts` (`OrchestratorTranscriptWriter` class + `OrchestratorEvent` discriminated union).
32
+
10
33
  ## [1.0.0] — 2026-05-26
11
34
 
12
35
  ### Breaking Changes
@@ -5,6 +5,30 @@ Format: newest first. Breaking changes are marked **△ Breaking**.
5
5
 
6
6
  ---
7
7
 
8
+ ## [1.0.3] — 2026-05-28
9
+
10
+ ### Fixed
11
+
12
+ - **FORGE-BUG-040 (critical) — `/forge:fix-bug` triage subagent received the orchestrator-only `fix_bug.md` body and executed the entire bug lifecycle in one phase, bypassing review/approve/commit gates.** The fix splits triage into a phase-scoped subagent workflow (new `triage.md` generated from `meta-bug-triage.md`) and corrects forge-cli's `BUG_PHASES` wiring (forge-cli v1.0.3 must be paired). Users on `forge@1.0.0–1.0.2` + `@entelligentsia/forgecli@1.0.0–1.0.2` were running with a non-functional `/forge:fix-bug` pipeline. Closes Entelligentsia/forge#110.
13
+
14
+ ### Added
15
+
16
+ - `meta/workflows/meta-bug-triage.md` — phase-scoped triage subagent workflow (`audience: subagent`, `phase: triage`) with the four required `checkMaterialization` markers and an explicit "triage NEVER writes `bug.status`" Iron Law.
17
+ - `init/base-pack/workflows/triage.md` — generated.
18
+ - `meta/fragments/tool-discipline.md` — new "Data boundaries" section enumerating paths owned by `forge_store`, `forge_artifact`, and `forge_collate`.
19
+ - `tools/artifact.cjs` — three new `ARTIFACT_CATALOG` entries: `task-prompt`, `sprint-requirements`, `sprint-completion-review`.
20
+
21
+ ### Changed
22
+
23
+ - `meta/workflows/meta-fix-bug.md` — § 2. Triage and § Triage Judgement trimmed; orchestrator now references `triage.md`. Route-reading retained.
24
+ - `init/smoke-test.md` — dropped hard-coded "18 workflows" count.
25
+
26
+ ### Migration
27
+
28
+ `1.0.2 → 1.0.3` regenerates `workflows:triage` (new) and `workflows:fix_bug` (regenerated). `breaking: false`. No FSM, schema, or store-record changes; in-flight bugs resume correctly on next `/forge:fix-bug` invocation.
29
+
30
+ ---
31
+
8
32
  ## [1.0.0] — 2026-05-26
9
33
 
10
34
  **v1.0 DevX Overhaul (FORGE-S26) — coordinated release with forge-cli v1.0.0.**
@@ -36,7 +36,7 @@ export function assertAudience(input, ctx) {
36
36
  if (audience === "any")
37
37
  return true;
38
38
  // "orchestrator-only" — allowed only from orchestrator context.
39
- if (audience === "orchestrator-only" && callerContext === "subagent") {
39
+ if (audience === "orchestrator-only" && callerContext.kind === "subagent") {
40
40
  ctx.ui.notify(`× workflow ${workflowName} is orchestrator-only; cannot run from subagent context — forge-cli internal error if you did not run it as a subagent`, "error");
41
41
  return false;
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"audience-gate.js","sourceRoot":"","sources":["../../../src/extensions/forgecli/audience-gate.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,o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c,CAAC,KAAyB,EAAE,GAA4B;IACrF,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACzC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,IAAI,kBAAkB,CAAC,GAAG,EAAE,CAAC;IAEtE,gDAAgD;IAChD,IAAI,QAAQ,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAEpC,gEAAgE;IAChE,IAAI,QAAQ,KAAK,mBAAmB,IAAI,aAAa,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC3E,GAAG,CAAC,EAAE,CAAC,MAAM,CACZ,cAAc,YAAY,wHAAwH,EAClJ,OAAO,CACP,CAAC;QACF,OAAO,KAAK,CAAC;IACd,CAAC;IAED,uDAAuD;IACvD,+EAA+E;IAC/E,4EAA4E;IAC5E,mDAAmD;IACnD,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -3,7 +3,7 @@ import { type ForgeToolDefs } from "./forge-tools.js";
3
3
  import { type PhaseDescriptor } from "./run-task.js";
4
4
  import { getSessionRegistry } from "./session-registry.js";
5
5
  export declare const BUG_PHASES: PhaseDescriptor[];
6
- export declare const BUG_SUMMARY_KEY_BY_ROLE: Record<string, string | null>;
6
+ export { BUG_SUMMARY_KEY_BY_ROLE } from "./subagent/phase-summary-map.js";
7
7
  export declare const BUG_TYPE_TOKENS: Record<string, {
8
8
  pass: string;
9
9
  fail: string;
@@ -83,4 +83,3 @@ export interface RegisterFixBugOptions {
83
83
  forgeToolDefs?: ForgeToolDefs;
84
84
  }
85
85
  export declare function registerFixBug(pi: ExtensionAPI, options?: RegisterFixBugOptions): void;
86
- export {};