@jenga-ai/agent 3.1.1 → 3.2.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 (39) hide show
  1. package/agents/developer.md +15 -15
  2. package/agents/scrum-master.md +17 -17
  3. package/agents/tester.md +25 -15
  4. package/lib/skill-allow-list.json +3 -2
  5. package/package.json +1 -1
  6. package/scripts/audit-twin-divergence.sh +625 -0
  7. package/scripts/check-public-playbook-steps.sh +136 -0
  8. package/skills/j-close-story/SKILL.md +1 -1
  9. package/skills/j-do/SKILL.md +19 -19
  10. package/skills/j-doc-sync/SKILL.md +12 -1
  11. package/skills/j-idea/SKILL.md +1 -1
  12. package/skills/j-init/SKILL.md +5 -4
  13. package/skills/j-init/assets/directory_structure.txt +1 -0
  14. package/skills/j-init/scripts/detect-existing-codebase.sh +2 -2
  15. package/skills/j-init/scripts/init.sh +13 -2
  16. package/skills/j-playbook/SKILL.md +81 -0
  17. package/skills/j-proceed/SKILL.md +1 -1
  18. package/skills/j-publish/SKILL.md +1 -1
  19. package/skills/j-publish/adapters/npm-ci.md +29 -0
  20. package/skills/j-publish/scripts/npm_ci_pipeline.sh +3 -0
  21. package/skills/j-publish/scripts/npm_pipeline.sh +18 -0
  22. package/skills/j-publish/scripts/npm_stage_pipeline.sh +81 -41
  23. package/skills/j-reconcile/SKILL.md +1 -0
  24. package/skills/j-redo/SKILL.md +1 -1
  25. package/skills/j-status/SKILL.md +12 -0
  26. package/skills/j-todo/SKILL.md +2 -2
  27. package/skills/j-uncharted/SKILL.md +8 -7
  28. package/skills/j-uncharted/scripts/validate-proposed-items.sh +18 -2
  29. package/skills/jenga/SKILL.md +55 -16
  30. package/skills/jenga/playbooks/idea-to-committed.json +20 -0
  31. package/skills/jenga/playbooks/schema.json +1 -1
  32. package/skills/jenga/scripts/load-playbooks.sh +855 -27
  33. package/skills/jenga/scripts/match-playbook.sh +1 -1
  34. package/skills/jenga/scripts/render-playbook-confirmation.sh +162 -8
  35. package/skills/jenga/scripts/run-playbook-step.sh +535 -42
  36. package/skills/jenga-permission-level/SKILL.md +4 -4
  37. package/templates/KNOWLEDGE_GRAPH_STUB_SCHEMA_TEMPLATE.md +128 -0
  38. package/templates/playbook-types.json +8 -0
  39. package/skills/jenga/playbooks/brainstorm-to-mirror.json +0 -22
@@ -28,7 +28,7 @@ examples:
28
28
  | 4 | Elevated | |
29
29
  | 5 | Unrestricted | |
30
30
 
31
- `defaultMode` stays `acceptEdits` at every level; only the `permissions` block changes. Levels are backed by template files at `templates/permission-levels/level-<n>-<name>.json`, e.g. `templates/permission-levels/level-4-elevated.json` (naming convention: `<name>` is the lowercase level name from the table above — Locked/Guarded/Standard/Elevated/Unrestricted). Those templates are owned by story E33_S01 and are the input the switch script (see below) copies from.
31
+ `defaultMode` stays `acceptEdits` at every level; only the `permissions` block changes. Levels are backed by template files at `$([ -f templates/permission-levels/level-<n>-<name>.json ] && echo templates/permission-levels/level-<n>-<name>.json || echo node_modules/@jenga-ai/agent/templates/permission-levels/level-<n>-<name>.json)`, e.g. `$([ -f templates/permission-levels/level-4-elevated.json ] && echo templates/permission-levels/level-4-elevated.json || echo node_modules/@jenga-ai/agent/templates/permission-levels/level-4-elevated.json)` (naming convention: `<name>` is the lowercase level name from the table above — Locked/Guarded/Standard/Elevated/Unrestricted). Those templates are owned by story E33_S01 and are the input the switch script (see below) copies from.
32
32
 
33
33
  ---
34
34
 
@@ -59,18 +59,18 @@ Before doing anything else, validate the argument:
59
59
  Do not inline the copy/update logic here — per this repo's scripts-over-inline-logic convention, the switch is owned entirely by a dedicated script:
60
60
 
61
61
  ```bash
62
- bash scripts/jenga-permission-level-switch.sh <n>
62
+ bash "$([ -f scripts/jenga-permission-level-switch.sh ] && echo scripts/jenga-permission-level-switch.sh || echo node_modules/@jenga-ai/agent/scripts/jenga-permission-level-switch.sh)" <n>
63
63
  ```
64
64
 
65
65
  This script (created by a separate task, E33_S02_T02) is responsible for:
66
- - Copying `templates/permission-levels/level-<n>-<name>.json` over both `.claude/settings.json` and `.agents/settings.json` as a **whole-file overwrite** — not a merge of the `permissions` block alone. Two fields vary by level and are expected to change on a switch: `permissions.deny` and `autoMode.allow`. All 5 templates carry byte-identical `defaultMode`, `env`, `hooks`, and `permissions.allow`; that invariant is what keeps the overwrite safe. Two consequences follow: any top-level key present in a destination file but absent from the templates is **silently dropped** by a switch, and any future per-level difference in `defaultMode`/`env`/`hooks` would take effect without warning. Keep the templates in sync with root `settings.json` for everything except those two varying fields.
66
+ - Copying `$([ -f templates/permission-levels/level-<n>-<name>.json ] && echo templates/permission-levels/level-<n>-<name>.json || echo node_modules/@jenga-ai/agent/templates/permission-levels/level-<n>-<name>.json)` over both `.claude/settings.json` and `.agents/settings.json` as a **whole-file overwrite** — not a merge of the `permissions` block alone. Two fields vary by level and are expected to change on a switch: `permissions.deny` and `autoMode.allow`. All 5 templates carry byte-identical `defaultMode`, `env`, `hooks`, and `permissions.allow`; that invariant is what keeps the overwrite safe. Two consequences follow: any top-level key present in a destination file but absent from the templates is **silently dropped** by a switch, and any future per-level difference in `defaultMode`/`env`/`hooks` would take effect without warning. Keep the templates in sync with root `settings.json` for everything except those two varying fields.
67
67
  - Creating or updating `.jenga-permission-level.json` at the repo root to `{"session_level": <n>}`.
68
68
 
69
69
  Relay the script's stdout to the user and honor its exit code:
70
70
  - Exit code `0` — report success, e.g. `Switched to level <n> (<name>).`
71
71
  - Non-zero exit code — report the script's error output verbatim and treat the switch as failed; do not claim success.
72
72
 
73
- If `scripts/jenga-permission-level-switch.sh` does not exist yet (e.g. E33_S02_T02 has not landed), report that clearly as a missing dependency rather than attempting to reimplement its logic inline.
73
+ If neither `scripts/jenga-permission-level-switch.sh` nor `node_modules/@jenga-ai/agent/scripts/jenga-permission-level-switch.sh` exists yet (e.g. E33_S02_T02 has not landed), report that clearly as a missing dependency rather than attempting to reimplement its logic inline.
74
74
 
75
75
  ### Session End
76
76
 
@@ -0,0 +1,128 @@
1
+ # Knowledge Graph — Coarse Graph STUB Schema
2
+
3
+ > **STUB — this is not E20_S01's schema.**
4
+ >
5
+ > This file defines a minimal, intentionally throwaway coarse-graph node/edge schema so that
6
+ > **E20_S08** ("Interactive Architecture Elicitation — Uncharted Integration") can be prototyped
7
+ > without waiting on **E20_S01** (the epic's real, eventual node/edge schema and JSON Schema
8
+ > publication under `project/knowledge-graph/graph.json`). E20_S01 has no committed landing
9
+ > schedule; this stub exists purely to unblock E20_S08's other tasks in the meantime.
10
+ >
11
+ > **This schema will be replaced wholesale once E20_S01 lands.** Nothing that depends on this file
12
+ > should assume field stability, forward compatibility, or migration support — when E20_S01's real
13
+ > schema is published, this file should be deleted (or reduced to a pointer at the real schema) and
14
+ > every consumer of it re-pointed. Do not extend this stub with new fields expecting them to survive
15
+ > the swap; keep it minimal.
16
+
17
+ ---
18
+
19
+ ## Node Schema
20
+
21
+ | Field | Type | Required | Description |
22
+ |---------------|---------------------|----------|-------------------------------------------------------------------------------|
23
+ | `id` | string | yes | Unique node identifier within the coarse graph. |
24
+ | `type` | string | yes | Node kind (e.g. `service`, `module`, `function`, `data-type`). Free-text in the stub — E20_S01 may formalize an enum. |
25
+ | `label` | string | yes | Short human-readable name for the node. |
26
+ | `description` | string | yes | Free-text description of what the node represents. |
27
+ | `source` | `human` \| `ast` | yes | Provenance of this node — see **Provenance Field** below. |
28
+ | `status` | `active` \| `superseded` | no | Present only once a conflict has been resolved against this node — see **Evidence-Wins Conflict Rule** below. Absence means `active`. |
29
+ | `superseded_by` | string (node `id`) | no | Required when `status: superseded`. Points at the node that superseded this one. |
30
+
31
+ ## Edge Schema
32
+
33
+ | Field | Type | Required | Description |
34
+ |---------------|--------|----------|----------------------------------------------------------|
35
+ | `id` | string | yes | Unique edge identifier within the coarse graph. |
36
+ | `from` | string | yes | Source node `id`. |
37
+ | `to` | string | yes | Target node `id`. |
38
+ | `type` | string | yes | Edge kind (e.g. `depends-on`, `calls`, `flows-to`). Free-text in the stub. |
39
+ | `description` | string | yes | Free-text description of the relationship. |
40
+
41
+ ---
42
+
43
+ ## Provenance Field — `source: human | ast`
44
+
45
+ Every stub node declares how it came to exist:
46
+
47
+ - **`human`** — written by a human-in-the-loop conversational elicitation session (the flow E20_S08
48
+ is building: propose understanding, ask the user to confirm or correct, write the resulting node).
49
+ This is a **coarse** node: it reflects a person's understanding of the code, not mechanical
50
+ extraction.
51
+ - **`ast`** — written by an automated, AST-derived extraction pipeline. This is a **fine-grained**
52
+ node: it reflects what the code mechanically, verifiably does. No such pipeline exists yet as of
53
+ this stub (it is scoped to E20_S02's prospective AST-diff maintenance work); the `ast` value is
54
+ defined here so the conflict rule below has both sides of the conflict to refer to from day one.
55
+
56
+ There is no third value. A node's `source` is fixed at creation time and is not itself mutated by
57
+ conflict resolution — conflict resolution only ever adds `status`/`superseded_by` to a `human` node
58
+ (see below); it never rewrites a node's `source`.
59
+
60
+ ## Evidence-Wins Conflict Rule
61
+
62
+ **Trigger:** a `human`-sourced coarse node and a (future) `ast`-sourced fine node both describe the
63
+ same underlying code, and they disagree — e.g. a human described a module's purpose one way during
64
+ elicitation, and a later AST-derived extraction of the same code area produces a materially
65
+ different description or classification.
66
+
67
+ **Rule:** the AST-derived (`source: ast`) entry takes precedence as the authoritative description.
68
+ The human-authored (`source: human`) entry is **not deleted**. Instead:
69
+
70
+ 1. The human node's `status` field is set to `superseded`.
71
+ 2. The human node's `superseded_by` field is set to the `id` of the AST-derived node that
72
+ superseded it.
73
+ 3. The AST-derived node is written normally (`source: ast`, no `status` field — it is the new
74
+ active, authoritative entry for that piece of code).
75
+
76
+ This preserves the human node as a retained, annotated rationale/history layer rather than silently
77
+ discarding a person's prior understanding — useful for later review of *why* a human once believed
78
+ something different, and for detecting elicitation sessions that were confidently wrong.
79
+
80
+ **Worked example:**
81
+
82
+ Before conflict resolution — a human-authored coarse node:
83
+
84
+ ```json
85
+ {
86
+ "id": "node-042",
87
+ "type": "module",
88
+ "label": "billing-worker",
89
+ "description": "Background job that retries failed charges.",
90
+ "source": "human"
91
+ }
92
+ ```
93
+
94
+ After a later AST-derived extraction disagrees (the module actually reconciles ledger entries, it
95
+ does not retry charges) and the conflict is resolved:
96
+
97
+ ```json
98
+ {
99
+ "id": "node-042",
100
+ "type": "module",
101
+ "label": "billing-worker",
102
+ "description": "Background job that retries failed charges.",
103
+ "source": "human",
104
+ "status": "superseded",
105
+ "superseded_by": "node-091"
106
+ }
107
+ ```
108
+
109
+ ```json
110
+ {
111
+ "id": "node-091",
112
+ "type": "module",
113
+ "label": "billing-worker",
114
+ "description": "Background job that reconciles ledger entries against the payment provider.",
115
+ "source": "ast"
116
+ }
117
+ ```
118
+
119
+ `node-042` remains in the graph, readable, and traceable to what replaced it — it is superseded, not
120
+ gone.
121
+
122
+ ---
123
+
124
+ ## Relationship to `[ARCH]` Board Tagging
125
+
126
+ Board items generated by the E20_S08 elicitation flow that populate this stub schema are tagged
127
+ `[ARCH]` (see `templates/SCRUM_BOARD_SCHEMA.md`'s "Board Item Tag Conventions" section) rather than
128
+ `[SPIKE]` — this is durable architectural-inventory record-keeping, not bounded research.
@@ -0,0 +1,8 @@
1
+ {
2
+ "_comment": "Canonical playbook output-type vocabulary for Epic E53's Playbooks v2 StepObject/output_types contract (E53_S03_T02). Extend this vocabulary by adding entries to the 'types' array below -- NEVER by code changes; skills/jenga/scripts/load-playbooks.sh references this file by name in its own header contract (see that script's 'TYPE REGISTRY' section). Governed by the Scrum Master: registry additions/changes route through the normal board-item process rather than an ungoverned edit to this file -- see docs/skill-authoring.md's 'Playbook Type Registry Governance' section for the full policy.",
3
+ "types": [
4
+ "text",
5
+ "id_list",
6
+ "file_list"
7
+ ]
8
+ }
@@ -1,22 +0,0 @@
1
- {
2
- "id": "brainstorm-to-mirror",
3
- "name": "Idea to Public Release",
4
- "description": "Takes a rough idea all the way from planning through implementation, committing, and a public mirror release -- the canonical end-to-end Jenga workflow chain.",
5
- "keywords": [
6
- "idea to release",
7
- "plan and ship",
8
- "idea to done",
9
- "full workflow",
10
- "end to end",
11
- "plan build ship",
12
- "idea to production"
13
- ],
14
- "examples": [
15
- "I have an idea, help me plan it, build it, and ship it",
16
- "take this feature from idea to committed and published",
17
- "let's go from a rough idea all the way to a public release",
18
- "plan this out, implement it, commit it, and push it to the public mirror",
19
- "walk this through the whole pipeline from brainstorm to release"
20
- ],
21
- "steps": ["brainstorm", "todo", "do", "dev-done", "mirror-public"]
22
- }