cleargate 0.8.2 → 0.10.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.
- package/CHANGELOG.md +190 -0
- package/README.md +11 -0
- package/dist/MANIFEST.json +259 -28
- package/dist/{chunk-OM4FAEA7.js → chunk-Q3BTSXCK.js} +69 -3
- package/dist/chunk-Q3BTSXCK.js.map +1 -0
- package/dist/cli.cjs +2621 -548
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2548 -560
- package/dist/cli.js.map +1 -1
- package/dist/lib/ledger.cjs +120 -0
- package/dist/lib/ledger.cjs.map +1 -0
- package/dist/lib/ledger.d.cts +64 -0
- package/dist/lib/ledger.d.ts +64 -0
- package/dist/lib/ledger.js +96 -0
- package/dist/lib/ledger.js.map +1 -0
- package/dist/templates/cleargate-planning/.claude/agents/architect.md +10 -8
- package/dist/templates/cleargate-planning/.claude/agents/cleargate-wiki-contradict.md +108 -0
- package/dist/templates/cleargate-planning/.claude/agents/cleargate-wiki-ingest.md +49 -3
- package/dist/templates/cleargate-planning/.claude/agents/cleargate-wiki-lint.md +6 -1
- package/dist/templates/cleargate-planning/.claude/agents/developer.md +29 -2
- package/dist/templates/cleargate-planning/.claude/agents/qa.md +50 -1
- package/dist/templates/cleargate-planning/.claude/agents/reporter.md +31 -9
- package/dist/templates/cleargate-planning/.claude/hooks/pre-tool-use-task.sh +148 -0
- package/dist/templates/cleargate-planning/.claude/hooks/session-start.sh +6 -0
- package/dist/templates/cleargate-planning/.claude/hooks/token-ledger.sh +314 -96
- package/dist/templates/cleargate-planning/.claude/settings.json +4 -0
- package/dist/templates/cleargate-planning/.claude/skills/sprint-execution/SKILL.md +473 -0
- package/dist/templates/cleargate-planning/.cleargate/config.example.yml +19 -0
- package/dist/templates/cleargate-planning/.cleargate/knowledge/cleargate-enforcement.md +542 -0
- package/dist/templates/cleargate-planning/.cleargate/knowledge/cleargate-protocol.md +102 -428
- package/dist/templates/cleargate-planning/.cleargate/knowledge/readiness-gates.md +31 -0
- package/dist/templates/cleargate-planning/.cleargate/knowledge/sprint-closeout-checklist.md +71 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/assert_story_files.mjs +24 -2
- package/dist/templates/cleargate-planning/.cleargate/scripts/close_sprint.mjs +387 -27
- package/dist/templates/cleargate-planning/.cleargate/scripts/dedupe_frontmatter.mjs +219 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/lib/report-filename.mjs +54 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/prep_doc_refresh.mjs +378 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/prep_qa_context.mjs +888 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/sprint_trends.mjs +71 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/suggest_improvements.mjs +355 -13
- package/dist/templates/cleargate-planning/.cleargate/scripts/test/test_flashcard_gate.sh +20 -20
- package/dist/templates/cleargate-planning/.cleargate/scripts/test/test_prep_qa_context.sh +482 -0
- package/dist/templates/cleargate-planning/.cleargate/scripts/write_dispatch.sh +125 -0
- package/dist/templates/cleargate-planning/.cleargate/templates/Bug.md +24 -1
- package/dist/templates/cleargate-planning/.cleargate/templates/CR.md +32 -1
- package/dist/templates/cleargate-planning/.cleargate/templates/Sprint Plan Template.md +48 -14
- package/dist/templates/cleargate-planning/.cleargate/templates/epic.md +37 -3
- package/dist/templates/cleargate-planning/.cleargate/templates/hotfix.md +50 -0
- package/dist/templates/cleargate-planning/.cleargate/templates/initiative.md +98 -29
- package/dist/templates/cleargate-planning/.cleargate/templates/proposal.md +17 -4
- package/dist/templates/cleargate-planning/.cleargate/templates/sprint_report.md +23 -4
- package/dist/templates/cleargate-planning/.cleargate/templates/story.md +55 -3
- package/dist/templates/cleargate-planning/CLAUDE.md +28 -10
- package/dist/templates/cleargate-planning/MANIFEST.json +259 -28
- package/dist/{whoami-CX7CXJD5.js → whoami-W4U6DPVG.js} +17 -17
- package/dist/whoami-W4U6DPVG.js.map +1 -0
- package/package.json +13 -2
- package/templates/cleargate-planning/.claude/agents/architect.md +10 -8
- package/templates/cleargate-planning/.claude/agents/cleargate-wiki-contradict.md +108 -0
- package/templates/cleargate-planning/.claude/agents/cleargate-wiki-ingest.md +49 -3
- package/templates/cleargate-planning/.claude/agents/cleargate-wiki-lint.md +6 -1
- package/templates/cleargate-planning/.claude/agents/developer.md +29 -2
- package/templates/cleargate-planning/.claude/agents/qa.md +50 -1
- package/templates/cleargate-planning/.claude/agents/reporter.md +31 -9
- package/templates/cleargate-planning/.claude/hooks/pre-tool-use-task.sh +148 -0
- package/templates/cleargate-planning/.claude/hooks/session-start.sh +6 -0
- package/templates/cleargate-planning/.claude/hooks/token-ledger.sh +314 -96
- package/templates/cleargate-planning/.claude/settings.json +4 -0
- package/templates/cleargate-planning/.claude/skills/sprint-execution/SKILL.md +473 -0
- package/templates/cleargate-planning/.cleargate/config.example.yml +19 -0
- package/templates/cleargate-planning/.cleargate/knowledge/cleargate-enforcement.md +542 -0
- package/templates/cleargate-planning/.cleargate/knowledge/cleargate-protocol.md +102 -428
- package/templates/cleargate-planning/.cleargate/knowledge/readiness-gates.md +31 -0
- package/templates/cleargate-planning/.cleargate/knowledge/sprint-closeout-checklist.md +71 -0
- package/templates/cleargate-planning/.cleargate/scripts/assert_story_files.mjs +24 -2
- package/templates/cleargate-planning/.cleargate/scripts/close_sprint.mjs +387 -27
- package/templates/cleargate-planning/.cleargate/scripts/dedupe_frontmatter.mjs +219 -0
- package/templates/cleargate-planning/.cleargate/scripts/lib/report-filename.mjs +54 -0
- package/templates/cleargate-planning/.cleargate/scripts/prep_doc_refresh.mjs +378 -0
- package/templates/cleargate-planning/.cleargate/scripts/prep_qa_context.mjs +888 -0
- package/templates/cleargate-planning/.cleargate/scripts/sprint_trends.mjs +71 -0
- package/templates/cleargate-planning/.cleargate/scripts/suggest_improvements.mjs +355 -13
- package/templates/cleargate-planning/.cleargate/scripts/test/test_flashcard_gate.sh +20 -20
- package/templates/cleargate-planning/.cleargate/scripts/test/test_prep_qa_context.sh +482 -0
- package/templates/cleargate-planning/.cleargate/scripts/write_dispatch.sh +125 -0
- package/templates/cleargate-planning/.cleargate/templates/Bug.md +24 -1
- package/templates/cleargate-planning/.cleargate/templates/CR.md +32 -1
- package/templates/cleargate-planning/.cleargate/templates/Sprint Plan Template.md +48 -14
- package/templates/cleargate-planning/.cleargate/templates/epic.md +37 -3
- package/templates/cleargate-planning/.cleargate/templates/hotfix.md +50 -0
- package/templates/cleargate-planning/.cleargate/templates/initiative.md +98 -29
- package/templates/cleargate-planning/.cleargate/templates/sprint_report.md +23 -4
- package/templates/cleargate-planning/.cleargate/templates/story.md +55 -3
- package/templates/cleargate-planning/CLAUDE.md +28 -10
- package/templates/cleargate-planning/MANIFEST.json +259 -28
- package/dist/chunk-OM4FAEA7.js.map +0 -1
- package/dist/whoami-CX7CXJD5.js.map +0 -1
- package/templates/cleargate-planning/.cleargate/templates/proposal.md +0 -61
|
@@ -7,32 +7,45 @@ This file is the content `cleargate init` injects into a downstream user's `CLAU
|
|
|
7
7
|
<!-- CLEARGATE:START -->
|
|
8
8
|
## 🔄 ClearGate Planning Framework
|
|
9
9
|
|
|
10
|
-
This repository uses **ClearGate** — a standalone planning framework for AI coding agents. ClearGate scaffolds *how work is planned* (
|
|
10
|
+
This repository uses **ClearGate** — a standalone planning framework for AI coding agents. ClearGate scaffolds *how work is planned* (initiatives → epics → stories → sprints) and defines a four-agent loop for execution. ClearGate does not run builds, tests, or deployments; execution tooling remains the target repo's own.
|
|
11
11
|
|
|
12
12
|
**Session-start orientation (read in this order):**
|
|
13
13
|
1. `.cleargate/wiki/index.md` — compiled awareness layer (~3k tokens). Lists active sprint, in-flight items, recent shipments, open gates, planned work, and topic synthesis pages. **Read this first** to know what exists before grepping raw files. If absent, run `cleargate wiki build`.
|
|
14
14
|
2. `.cleargate/knowledge/cleargate-protocol.md` — delivery protocol (non-negotiable rules).
|
|
15
15
|
3. `.cleargate/FLASHCARD.md` — lessons tagged by topic (`#schema`, `#auth`, etc.). Grep for your area before starting.
|
|
16
|
+
4. `.cleargate/knowledge/cleargate-enforcement.md` — hook-enforced rules (worktree mechanics, file-surface contract, lifecycle reconciler, lane rubric, doctor exit codes, etc.). Read only when a CLI hook surfaces an error or when triaging a v2-mode question.
|
|
16
17
|
|
|
17
18
|
**Triage first, draft second.** Every user request gets classified (Epic / Story / CR / Bug / Pull / Push) *before* any drafting. If the type is ambiguous, ask ONE targeted question — do not guess.
|
|
18
19
|
|
|
19
|
-
**
|
|
20
|
+
**Sprint execution.** When a sprint is active, the orchestration playbook lives at `.claude/skills/sprint-execution/SKILL.md` — load it before dispatching any execution agent (Architect / Developer / QA / Reporter). The skill is the canonical four-agent-loop spec; the always-on CLAUDE.md keeps only the halt-rules and the load-skill contract.
|
|
20
21
|
|
|
21
|
-
**
|
|
22
|
+
**Skill auto-load directive.** When the SessionStart banner emits `Load skill: <name>`, invoke the Skill tool to load it before continuing. Claude Code's description-match auto-load is advisory; this rule is the contract.
|
|
23
|
+
|
|
24
|
+
**Codebase is source of truth.** Wiki, memory, and `context_source` are derived caches. On conflict between cache and code, the code wins; the cache rebuilds. Before stating that a capability exists or doesn't exist, grep the code.
|
|
25
|
+
|
|
26
|
+
**Duplicate check before drafting.** Before drafting an Initiative or work item, grep `.cleargate/delivery/archive/` + `.cleargate/FLASHCARD.md` for similar past work. If you find overlap, surface it as a one-liner (*"This is very close to STORY-003-05 shipped in SPRINT-01 — are you extending it or redoing it?"*) instead of drafting a duplicate. If the request names an integration, feature, or capability, also grep the source tree for existing implementations and cite findings in `## Existing Surfaces`.
|
|
27
|
+
|
|
28
|
+
**Halt at gates.** You halt at Gate 1 (Initiative approval) and Gate 2 (Ambiguity resolution) and wait for explicit human sign-off. You never call `cleargate_push_item` without `approved: true` (hard reject) and explicit human confirmation. Readiness gates (`cached_gate_result.pass`) are advisory by default — the push proceeds and the item body receives an `[advisory: gate_failed — <criteria>]` prefix; opt into hard-reject via `STRICT_PUSH_GATES=true` on the MCP server.
|
|
29
|
+
|
|
30
|
+
**Sprint mode.** Read `execution_mode:` in the active sprint's frontmatter before spawning Developer/QA. `v1` = advisory; `v2` = enforce the rules in `cleargate-enforcement.md`. Default `v1`.
|
|
31
|
+
|
|
32
|
+
**Brief is the universal pre-push handshake.** Every work-item template's `<instructions>` block tells you to render a Brief in chat after Writing the document — Summary / Open Questions / Edge Cases / Risks / Ambiguity. Halt for human review. When ambiguity reaches 🟢, push via `cleargate_push_item` automatically — the same approval covers Gate 1 and the push.
|
|
33
|
+
|
|
34
|
+
**Boundary gates (CR-017).** `cleargate sprint init` runs the decomposition gate; `close_sprint.mjs` runs the lifecycle reconciler. Both block in v2.
|
|
35
|
+
|
|
36
|
+
**Sprint close is Gate-4-class (CR-019).** Run `close_sprint.mjs` with no flags first; surface the prompt verbatim; halt. Never pass `--assume-ack` autonomously. Pre-close enforces Steps 2.7 (no leftover worktrees) + 2.8 (sprint branch merged to main) under v2; failure halts close. Post-close prints a 6-item handoff list (Step 8) summarizing commits, merge state, wiki ingest, flashcards, artifacts, and next-sprint preflight.
|
|
22
37
|
|
|
23
38
|
**Drafting work items:**
|
|
24
|
-
- Use the templates in `.cleargate/templates/` (`
|
|
39
|
+
- Use the templates in `.cleargate/templates/` (`epic.md`, `story.md`, `CR.md`, `Bug.md`, `Sprint Plan Template.md`, `initiative.md`).
|
|
25
40
|
- Save drafts to `.cleargate/delivery/pending-sync/{TYPE}-{ID}-{Name}.md`.
|
|
26
41
|
- After `cleargate_push_item` returns a Remote ID, update the frontmatter AND move the file to `.cleargate/delivery/archive/` — these two happen atomically, never one without the other.
|
|
27
42
|
- **Story granularity.** When decomposing an epic into stories, run the Granularity Rubric at the top of `story.md`. If a candidate story trips any signal (unrelated goals joined, >5 Gherkin scenarios, subsystems span, L4 complexity), emit two stories with consecutive IDs instead. Splits and merges are free at decomposition time — no remote IDs exist yet.
|
|
28
43
|
|
|
29
|
-
**
|
|
30
|
-
|
|
31
|
-
- `
|
|
32
|
-
- `qa.md` — independent verification gate; re-runs checks; never commits, never edits.
|
|
33
|
-
- `reporter.md` — one sprint retrospective at sprint end; synthesizes token ledger + git log + flashcards into `REPORT.md`.
|
|
44
|
+
**Initiative Intake.** Stakeholder input arrives via two paths: (1) MCP pull — call `cleargate_pull_initiative` with the remote ID; the tool writes `pending-sync/INITIATIVE-NNN_*.md` automatically; read the result and present a Brief. (2) Manual paste — human pastes the text; triage it, write `pending-sync/INITIATIVE-NNN_*.md` using `templates/initiative.md`, present a Brief. In both cases, after Gate 1 the file moves to `archive/` stamped with `triaged_at:` and `spawned_items:`.
|
|
45
|
+
|
|
46
|
+
**State-aware surface.** At session start, `cleargate doctor --session-start` (invoked by the SessionStart hook) emits one banner line before any other output: `ClearGate state: pre-member — local planning enabled, sync requires join.` OR `ClearGate state: member (project: <project_id>) — full surface enabled.` In **pre-member** state (no valid join token on disk), only local-planning commands are reachable: `init`, `join`, `whoami`, `wiki *`, `gate *`, `stamp`, `doctor`, `scaffold-lint`, `sprint *`, `story *`, `state *`, `upgrade`, `uninstall`. Commands `push`, `pull`, `sync`, `sync-log`, `conflicts`, and `admin *` (except `admin login`) require membership and exit 2 with a redirect: `Run: cleargate join <invite-url>`. If the SessionStart banner says `pre-member`, do not suggest push/pull/sync to the user — instead ask for an invite URL and direct them to `cleargate join`.
|
|
34
47
|
|
|
35
|
-
**Conversational style.** Keep replies terse. Details live in the work-item file and `REPORT.md`, not in chat. State results and next steps; skip narration of your own thought process.
|
|
48
|
+
**Conversational style.** Keep replies terse. Details live in the work-item file and `REPORT.md`, not in chat. State results and next steps; skip narration of your own thought process. After Writing or Editing any file under `.cleargate/delivery/**`, briefly note the ingest result if the PostToolUse hook surfaced one — one short sentence (`✅ ingested as <bucket>/<id>.md` / `⚠️ gate failed: <criterion>` / `🔴 ingest error — see .cleargate/hook-log/gate-check.log`). Do not narrate when nothing fired (skip-excluded paths). This is conversational confirmation, not retry logic.
|
|
36
49
|
|
|
37
50
|
**Support infrastructure.** Flashcard protocol: `.claude/skills/flashcard/SKILL.md`. Token-ledger hook: `.claude/hooks/token-ledger.sh`, wired via `.claude/settings.json` (SubagentStop) — auto-logs agent cost per sprint for the Reporter.
|
|
38
51
|
|
|
@@ -41,4 +54,9 @@ This repository uses **ClearGate** — a standalone planning framework for AI co
|
|
|
41
54
|
**Project overrides.** Content OUTSIDE this `<!-- CLEARGATE:START -->...<!-- CLEARGATE:END -->` block takes precedence where it conflicts with ClearGate defaults.
|
|
42
55
|
|
|
43
56
|
**Scope reminder.** ClearGate is a *planning* framework. It scaffolds how work gets planned and how the four-agent loop runs. It does not replace your project's build system, CI, test runner, or deployment tooling.
|
|
57
|
+
|
|
58
|
+
**Guardrails for the conversational agent:**
|
|
59
|
+
- Sprint close requires explicit human ack. Run close_sprint.mjs without flags first; surface the "re-run with --assume-ack" prompt verbatim and halt. Never pass --assume-ack yourself — that flag is reserved for automated tests.
|
|
60
|
+
|
|
61
|
+
**Doc & metadata refresh on close.** During Gate 4 ack, read `.cleargate/sprint-runs/<id>/.doc-refresh-checklist.md` (generated by `prep_doc_refresh.mjs`) and apply or punt each `- [ ]` item per the canonical list at `.cleargate/knowledge/sprint-closeout-checklist.md`. Items already marked `- [x]` indicate "no changes detected, skip."
|
|
44
62
|
<!-- CLEARGATE:END -->
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
"cleargate_version": "0.
|
|
3
|
-
"generated_at": "2026-
|
|
2
|
+
"cleargate_version": "0.10.0",
|
|
3
|
+
"generated_at": "2026-05-02T19:21:41.996Z",
|
|
4
4
|
"files": [
|
|
5
5
|
{
|
|
6
6
|
"path": ".claude/agents/architect.md",
|
|
7
|
-
"sha256": "
|
|
7
|
+
"sha256": "5aa58a549f74ecc73be1630428ef1903faae5c3779b7b5371307c5cb63621026",
|
|
8
|
+
"tier": "agent",
|
|
9
|
+
"overwrite_policy": "always",
|
|
10
|
+
"preserve_on_uninstall": false
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"path": ".claude/agents/cleargate-wiki-contradict.md",
|
|
14
|
+
"sha256": "1b7ca28889dfa1ab704e05b90179547bee1ae683b68722c99a1daec990e8572b",
|
|
8
15
|
"tier": "agent",
|
|
9
16
|
"overwrite_policy": "always",
|
|
10
17
|
"preserve_on_uninstall": false
|
|
11
18
|
},
|
|
12
19
|
{
|
|
13
20
|
"path": ".claude/agents/cleargate-wiki-ingest.md",
|
|
14
|
-
"sha256": "
|
|
21
|
+
"sha256": "4b14aed168d30807a1325de8c065bb57e2bc66271a0cffc71a21481c227b453b",
|
|
15
22
|
"tier": "agent",
|
|
16
23
|
"overwrite_policy": "always",
|
|
17
24
|
"preserve_on_uninstall": false
|
|
18
25
|
},
|
|
19
26
|
{
|
|
20
27
|
"path": ".claude/agents/cleargate-wiki-lint.md",
|
|
21
|
-
"sha256": "
|
|
28
|
+
"sha256": "42067fd728e64ac1ff1ace5822b8f8c3ddf1ba70fd0fbddf0e8cb19d5d699e77",
|
|
22
29
|
"tier": "agent",
|
|
23
30
|
"overwrite_policy": "always",
|
|
24
31
|
"preserve_on_uninstall": false
|
|
@@ -32,21 +39,21 @@
|
|
|
32
39
|
},
|
|
33
40
|
{
|
|
34
41
|
"path": ".claude/agents/developer.md",
|
|
35
|
-
"sha256": "
|
|
42
|
+
"sha256": "55790014320187e500f6b904756bbc8bda4806274805e883d62492bf75a34f12",
|
|
36
43
|
"tier": "agent",
|
|
37
44
|
"overwrite_policy": "always",
|
|
38
45
|
"preserve_on_uninstall": false
|
|
39
46
|
},
|
|
40
47
|
{
|
|
41
48
|
"path": ".claude/agents/qa.md",
|
|
42
|
-
"sha256": "
|
|
49
|
+
"sha256": "b6ac9d814e1bbd1fb9a062ce7775e34da1d1e5e6fc35140b977f30b2632654fa",
|
|
43
50
|
"tier": "agent",
|
|
44
51
|
"overwrite_policy": "always",
|
|
45
52
|
"preserve_on_uninstall": false
|
|
46
53
|
},
|
|
47
54
|
{
|
|
48
55
|
"path": ".claude/agents/reporter.md",
|
|
49
|
-
"sha256": "
|
|
56
|
+
"sha256": "d8e11e0a5eeb7bf298df2e79ce0f6b8b4d87e3a2d6666f458ae143ef8e593ea1",
|
|
50
57
|
"tier": "agent",
|
|
51
58
|
"overwrite_policy": "always",
|
|
52
59
|
"preserve_on_uninstall": false
|
|
@@ -86,9 +93,16 @@
|
|
|
86
93
|
"overwrite_policy": "always",
|
|
87
94
|
"preserve_on_uninstall": false
|
|
88
95
|
},
|
|
96
|
+
{
|
|
97
|
+
"path": ".claude/hooks/pre-tool-use-task.sh",
|
|
98
|
+
"sha256": "79fdd30e3f301cb89757aa2279a5fb8cc3a91493b62d5c801517853500368e7f",
|
|
99
|
+
"tier": "hook",
|
|
100
|
+
"overwrite_policy": "always",
|
|
101
|
+
"preserve_on_uninstall": false
|
|
102
|
+
},
|
|
89
103
|
{
|
|
90
104
|
"path": ".claude/hooks/session-start.sh",
|
|
91
|
-
"sha256": "
|
|
105
|
+
"sha256": "b266a5567cc84c02d041e570569962c003daaa69b6aee244173e740dedbf4ee2",
|
|
92
106
|
"tier": "hook",
|
|
93
107
|
"overwrite_policy": "pin-aware",
|
|
94
108
|
"preserve_on_uninstall": false
|
|
@@ -102,14 +116,14 @@
|
|
|
102
116
|
},
|
|
103
117
|
{
|
|
104
118
|
"path": ".claude/hooks/token-ledger.sh",
|
|
105
|
-
"sha256": "
|
|
119
|
+
"sha256": "b766f18e005dea89d63c2dae9c436e3e52ef0e4828ea895ce94abfecc68f0ce2",
|
|
106
120
|
"tier": "hook",
|
|
107
121
|
"overwrite_policy": "always",
|
|
108
122
|
"preserve_on_uninstall": false
|
|
109
123
|
},
|
|
110
124
|
{
|
|
111
125
|
"path": ".claude/settings.json",
|
|
112
|
-
"sha256": "
|
|
126
|
+
"sha256": "8c3c8fe2bd2a2c23e3faa56fad94352c66a11646d12a4ca79ff95d578e589ec0",
|
|
113
127
|
"tier": "cli-config",
|
|
114
128
|
"overwrite_policy": "merge-3way",
|
|
115
129
|
"preserve_on_uninstall": false
|
|
@@ -121,6 +135,13 @@
|
|
|
121
135
|
"overwrite_policy": "always",
|
|
122
136
|
"preserve_on_uninstall": false
|
|
123
137
|
},
|
|
138
|
+
{
|
|
139
|
+
"path": ".claude/skills/sprint-execution/SKILL.md",
|
|
140
|
+
"sha256": "f403bb55f4cdce4b82ce3fdd59b03dd55d8f3f64bdc0e1d1c2abf9b2121efa3d",
|
|
141
|
+
"tier": "skill",
|
|
142
|
+
"overwrite_policy": "always",
|
|
143
|
+
"preserve_on_uninstall": false
|
|
144
|
+
},
|
|
124
145
|
{
|
|
125
146
|
"path": ".cleargate/FLASHCARD.md",
|
|
126
147
|
"sha256": null,
|
|
@@ -128,65 +149,275 @@
|
|
|
128
149
|
"overwrite_policy": "skip",
|
|
129
150
|
"preserve_on_uninstall": true
|
|
130
151
|
},
|
|
152
|
+
{
|
|
153
|
+
"path": ".cleargate/knowledge/cleargate-enforcement.md",
|
|
154
|
+
"sha256": "11ff8004145d627ce3885976304797465e07ea80f2e37001304afa9087852e7f",
|
|
155
|
+
"tier": "protocol",
|
|
156
|
+
"overwrite_policy": "merge-3way",
|
|
157
|
+
"preserve_on_uninstall": false
|
|
158
|
+
},
|
|
131
159
|
{
|
|
132
160
|
"path": ".cleargate/knowledge/cleargate-protocol.md",
|
|
133
|
-
"sha256": "
|
|
161
|
+
"sha256": "50e999717b9c9e1c11638f3f2433f413d177ed8ddf3cffdbb20b50c8807b1fc5",
|
|
134
162
|
"tier": "protocol",
|
|
135
163
|
"overwrite_policy": "merge-3way",
|
|
136
164
|
"preserve_on_uninstall": false
|
|
137
165
|
},
|
|
138
166
|
{
|
|
139
167
|
"path": ".cleargate/knowledge/readiness-gates.md",
|
|
140
|
-
"sha256": "
|
|
168
|
+
"sha256": "6125b57bfdcdd5d4fabe886770d9b062d76df9a232f4997dbedf3322aefdf1b5",
|
|
141
169
|
"tier": "protocol",
|
|
142
170
|
"overwrite_policy": "merge-3way",
|
|
143
171
|
"preserve_on_uninstall": false
|
|
144
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"path": ".cleargate/knowledge/sprint-closeout-checklist.md",
|
|
175
|
+
"sha256": "d44f57445188bdefb18b39c6c121a1f52d32d9ca6122df91e54855e87fc2233e",
|
|
176
|
+
"tier": "protocol",
|
|
177
|
+
"overwrite_policy": "merge-3way",
|
|
178
|
+
"preserve_on_uninstall": false
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"path": ".cleargate/scripts/assert_story_files.mjs",
|
|
182
|
+
"sha256": "74db9e12008492e40c77cc9bffac4c689621ac5eededf9b342a87e45f918f003",
|
|
183
|
+
"tier": "script",
|
|
184
|
+
"overwrite_policy": "always",
|
|
185
|
+
"preserve_on_uninstall": false
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"path": ".cleargate/scripts/close_sprint.mjs",
|
|
189
|
+
"sha256": "d02be1cb8e0290782197a8b775c52b8f3064aaf661f5466c218dadb62179690a",
|
|
190
|
+
"tier": "script",
|
|
191
|
+
"overwrite_policy": "always",
|
|
192
|
+
"preserve_on_uninstall": false
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"path": ".cleargate/scripts/constants.mjs",
|
|
196
|
+
"sha256": "6f3fd11046bfd3d7f6b90b9ca70e02612a5db05ca21f2f2db3dce4473e720ce4",
|
|
197
|
+
"tier": "script",
|
|
198
|
+
"overwrite_policy": "always",
|
|
199
|
+
"preserve_on_uninstall": false
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"path": ".cleargate/scripts/dedupe_frontmatter.mjs",
|
|
203
|
+
"sha256": "6bf2816399cad2ab6f8f770de5eb920c3547b6fad9295c81f08aa6a4f894ef21",
|
|
204
|
+
"tier": "script",
|
|
205
|
+
"overwrite_policy": "always",
|
|
206
|
+
"preserve_on_uninstall": false
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"path": ".cleargate/scripts/file_surface_diff.sh",
|
|
210
|
+
"sha256": "a1c250ba35face9124183273fb04d45fdd4f8e43f405be4a765aeb58582753e9",
|
|
211
|
+
"tier": "script",
|
|
212
|
+
"overwrite_policy": "always",
|
|
213
|
+
"preserve_on_uninstall": false
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"path": ".cleargate/scripts/gate-checks.json",
|
|
217
|
+
"sha256": "188ef9995ce14e609ecf042563bab44d461df5315a4fd698e3eebfaf84db3b6a",
|
|
218
|
+
"tier": "script",
|
|
219
|
+
"overwrite_policy": "always",
|
|
220
|
+
"preserve_on_uninstall": false
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"path": ".cleargate/scripts/init_gate_config.sh",
|
|
224
|
+
"sha256": "47f4a9c6609d22d66acc9ccbceb1a144ad590d5ed17159ae5fb9811002a087e8",
|
|
225
|
+
"tier": "script",
|
|
226
|
+
"overwrite_policy": "always",
|
|
227
|
+
"preserve_on_uninstall": false
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"path": ".cleargate/scripts/init_sprint.mjs",
|
|
231
|
+
"sha256": "1d0f41df4325ea32981256aec15ed43eef09aba2a16ab4ba6d310cd61685556e",
|
|
232
|
+
"tier": "script",
|
|
233
|
+
"overwrite_policy": "always",
|
|
234
|
+
"preserve_on_uninstall": false
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"path": ".cleargate/scripts/lib/report-filename.mjs",
|
|
238
|
+
"sha256": "c26e2c0557f5e33d84058fc34db5c3258e5050093eabeb09fb22d067e458a8e2",
|
|
239
|
+
"tier": "script",
|
|
240
|
+
"overwrite_policy": "always",
|
|
241
|
+
"preserve_on_uninstall": false
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"path": ".cleargate/scripts/pre_gate_common.sh",
|
|
245
|
+
"sha256": "fd9af416b6db636901354fca64e60adcce9d4ce71dac96f2d718562a4bdb27e0",
|
|
246
|
+
"tier": "script",
|
|
247
|
+
"overwrite_policy": "always",
|
|
248
|
+
"preserve_on_uninstall": false
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"path": ".cleargate/scripts/pre_gate_runner.sh",
|
|
252
|
+
"sha256": "7f221089a353391f6e917c03a6813a26b6650a8b4e7e1c6a2bd845fa4ae081ca",
|
|
253
|
+
"tier": "script",
|
|
254
|
+
"overwrite_policy": "always",
|
|
255
|
+
"preserve_on_uninstall": false
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"path": ".cleargate/scripts/prefill_report.mjs",
|
|
259
|
+
"sha256": "bee417d96150410f78262a7fb4f485bf2f2e4191b8818085bdf60a664ebf7d62",
|
|
260
|
+
"tier": "script",
|
|
261
|
+
"overwrite_policy": "always",
|
|
262
|
+
"preserve_on_uninstall": false
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"path": ".cleargate/scripts/prep_doc_refresh.mjs",
|
|
266
|
+
"sha256": "822f887fc6c2754d2314f72b8ae62e1f20707b350b04c9867f9fd65068b21d79",
|
|
267
|
+
"tier": "script",
|
|
268
|
+
"overwrite_policy": "always",
|
|
269
|
+
"preserve_on_uninstall": false
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"path": ".cleargate/scripts/prep_qa_context.mjs",
|
|
273
|
+
"sha256": "68d69678f72fd6aa64bcf359fbd74f9c5b6b4fe598374f13c1261148b9907cab",
|
|
274
|
+
"tier": "script",
|
|
275
|
+
"overwrite_policy": "always",
|
|
276
|
+
"preserve_on_uninstall": false
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"path": ".cleargate/scripts/run_script.sh",
|
|
280
|
+
"sha256": "63ff100bb56361b06825d20dc601975e6df32bb688fe112b0d705dc45129ca20",
|
|
281
|
+
"tier": "script",
|
|
282
|
+
"overwrite_policy": "always",
|
|
283
|
+
"preserve_on_uninstall": false
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"path": ".cleargate/scripts/sprint_trends.mjs",
|
|
287
|
+
"sha256": "58732d158dcffca71fdc935200bbf9f8f14058cec7e05590345c335151dfa156",
|
|
288
|
+
"tier": "script",
|
|
289
|
+
"overwrite_policy": "always",
|
|
290
|
+
"preserve_on_uninstall": false
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"path": ".cleargate/scripts/state.schema.json",
|
|
294
|
+
"sha256": "d4e1c076764e5dc0573805502b3164d3b7d4977871cb67f5eca8a5035aeee37d",
|
|
295
|
+
"tier": "script",
|
|
296
|
+
"overwrite_policy": "always",
|
|
297
|
+
"preserve_on_uninstall": false
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"path": ".cleargate/scripts/suggest_improvements.mjs",
|
|
301
|
+
"sha256": "7d5853bf477447ae9090485648c3ba9426419504c6d36626c32454bf578c74a6",
|
|
302
|
+
"tier": "script",
|
|
303
|
+
"overwrite_policy": "always",
|
|
304
|
+
"preserve_on_uninstall": false
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"path": ".cleargate/scripts/surface-whitelist.txt",
|
|
308
|
+
"sha256": "c1c14349265d741570dc4b0e61501c2a9e898a25cefad93911ef1298cf4d74c7",
|
|
309
|
+
"tier": "script",
|
|
310
|
+
"overwrite_policy": "always",
|
|
311
|
+
"preserve_on_uninstall": false
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"path": ".cleargate/scripts/test_ratchet.mjs",
|
|
315
|
+
"sha256": "429f6034ad6946f906c9068e9604d5348898687af0cf56badcae673b04369c5b",
|
|
316
|
+
"tier": "script",
|
|
317
|
+
"overwrite_policy": "always",
|
|
318
|
+
"preserve_on_uninstall": false
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"path": ".cleargate/scripts/test/test_assert_story_files.sh",
|
|
322
|
+
"sha256": "6aace15a0de4d07b4b9e7454d2b38e266b7a80e265281135a050bd9f6be83aab",
|
|
323
|
+
"tier": "script",
|
|
324
|
+
"overwrite_policy": "always",
|
|
325
|
+
"preserve_on_uninstall": false
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"path": ".cleargate/scripts/test/test_file_surface.sh",
|
|
329
|
+
"sha256": "ada0e9583717a38bd912c0af16bb0e11c0b719a96df6dd511c879f0cf367788d",
|
|
330
|
+
"tier": "script",
|
|
331
|
+
"overwrite_policy": "always",
|
|
332
|
+
"preserve_on_uninstall": false
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"path": ".cleargate/scripts/test/test_flashcard_gate.sh",
|
|
336
|
+
"sha256": "0e05a7fbaa86aeb9401e7df09696b9c547896512c41aa738a7c812d69d135916",
|
|
337
|
+
"tier": "script",
|
|
338
|
+
"overwrite_policy": "always",
|
|
339
|
+
"preserve_on_uninstall": false
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"path": ".cleargate/scripts/test/test_prep_qa_context.sh",
|
|
343
|
+
"sha256": "fd198bbc5d1faeaebd18ac72e5bcc2d84f931f035175bd51048ee04dcbd7ae0d",
|
|
344
|
+
"tier": "script",
|
|
345
|
+
"overwrite_policy": "always",
|
|
346
|
+
"preserve_on_uninstall": false
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"path": ".cleargate/scripts/test/test_test_ratchet.sh",
|
|
350
|
+
"sha256": "bfa13cb347824a525b636538d330a3ee3765f7908707f94149f2ffe69439729b",
|
|
351
|
+
"tier": "script",
|
|
352
|
+
"overwrite_policy": "always",
|
|
353
|
+
"preserve_on_uninstall": false
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"path": ".cleargate/scripts/update_state.mjs",
|
|
357
|
+
"sha256": "19eb2a3f7b0cc027a2805a49ba14029bcb70dbc8e98299375a375a6fe4adf2c5",
|
|
358
|
+
"tier": "script",
|
|
359
|
+
"overwrite_policy": "always",
|
|
360
|
+
"preserve_on_uninstall": false
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"path": ".cleargate/scripts/validate_bounce_readiness.mjs",
|
|
364
|
+
"sha256": "e4c6bead578a75a4f62fddbc1bccd40e92cc64f6136b3f893bb7cf50bacbd6ff",
|
|
365
|
+
"tier": "script",
|
|
366
|
+
"overwrite_policy": "always",
|
|
367
|
+
"preserve_on_uninstall": false
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"path": ".cleargate/scripts/validate_state.mjs",
|
|
371
|
+
"sha256": "a1ad7e5f0525d3302759f9a04514e7205141c124abeb42fcda1f9d6042eca926",
|
|
372
|
+
"tier": "script",
|
|
373
|
+
"overwrite_policy": "always",
|
|
374
|
+
"preserve_on_uninstall": false
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"path": ".cleargate/scripts/write_dispatch.sh",
|
|
378
|
+
"sha256": "4af4035555f4c6852ffd8f4635734931cfa2baef706f27f001bf0b2c64f7a0be",
|
|
379
|
+
"tier": "script",
|
|
380
|
+
"overwrite_policy": "always",
|
|
381
|
+
"preserve_on_uninstall": false
|
|
382
|
+
},
|
|
145
383
|
{
|
|
146
384
|
"path": ".cleargate/templates/Bug.md",
|
|
147
|
-
"sha256": "
|
|
385
|
+
"sha256": "d58c3d5d19387e7749c62570931a829fd1fc31bda83b6edba2b0854dafd6936d",
|
|
148
386
|
"tier": "template",
|
|
149
387
|
"overwrite_policy": "merge-3way",
|
|
150
388
|
"preserve_on_uninstall": false
|
|
151
389
|
},
|
|
152
390
|
{
|
|
153
391
|
"path": ".cleargate/templates/CR.md",
|
|
154
|
-
"sha256": "
|
|
392
|
+
"sha256": "434ac96bfd9aa8732a89d18ceb546101737b2b6fdc1b3858b5ea0153837bc6ee",
|
|
155
393
|
"tier": "template",
|
|
156
394
|
"overwrite_policy": "merge-3way",
|
|
157
395
|
"preserve_on_uninstall": false
|
|
158
396
|
},
|
|
159
397
|
{
|
|
160
398
|
"path": ".cleargate/templates/epic.md",
|
|
161
|
-
"sha256": "
|
|
399
|
+
"sha256": "bbb250b5ca905ed6f48b55b0c982296899d04a492f9427195960cee3e3632594",
|
|
162
400
|
"tier": "template",
|
|
163
401
|
"overwrite_policy": "merge-3way",
|
|
164
402
|
"preserve_on_uninstall": false
|
|
165
403
|
},
|
|
166
404
|
{
|
|
167
405
|
"path": ".cleargate/templates/hotfix.md",
|
|
168
|
-
"sha256": "
|
|
406
|
+
"sha256": "2d4fe14f12dbdae75cd8298bc547f39da89ecc9aaf917d32b3298a9b4936aaa2",
|
|
169
407
|
"tier": "template",
|
|
170
408
|
"overwrite_policy": "merge-3way",
|
|
171
409
|
"preserve_on_uninstall": false
|
|
172
410
|
},
|
|
173
411
|
{
|
|
174
412
|
"path": ".cleargate/templates/initiative.md",
|
|
175
|
-
"sha256": "
|
|
176
|
-
"tier": "template",
|
|
177
|
-
"overwrite_policy": "merge-3way",
|
|
178
|
-
"preserve_on_uninstall": false
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"path": ".cleargate/templates/proposal.md",
|
|
182
|
-
"sha256": "227907f5de028453168c487e9c4ec4d4acd578298d13d658f7a7b63ef76dc23d",
|
|
413
|
+
"sha256": "08730306824f184a7d972346640493f100a5d1b44f0efe0ed855e1acedfd65d6",
|
|
183
414
|
"tier": "template",
|
|
184
415
|
"overwrite_policy": "merge-3way",
|
|
185
416
|
"preserve_on_uninstall": false
|
|
186
417
|
},
|
|
187
418
|
{
|
|
188
419
|
"path": ".cleargate/templates/Sprint Plan Template.md",
|
|
189
|
-
"sha256": "
|
|
420
|
+
"sha256": "8c359d0d7d06706cbae4c7c28777229ca3f8c4e1cc819795b4d39b349acbe9c1",
|
|
190
421
|
"tier": "template",
|
|
191
422
|
"overwrite_policy": "merge-3way",
|
|
192
423
|
"preserve_on_uninstall": false
|
|
@@ -200,14 +431,14 @@
|
|
|
200
431
|
},
|
|
201
432
|
{
|
|
202
433
|
"path": ".cleargate/templates/sprint_report.md",
|
|
203
|
-
"sha256": "
|
|
434
|
+
"sha256": "84e32e956eb1e8a9c97be1c346b695df316a9e47e17402f3d6581e3ffdbc4d2d",
|
|
204
435
|
"tier": "template",
|
|
205
436
|
"overwrite_policy": "merge-3way",
|
|
206
437
|
"preserve_on_uninstall": false
|
|
207
438
|
},
|
|
208
439
|
{
|
|
209
440
|
"path": ".cleargate/templates/story.md",
|
|
210
|
-
"sha256": "
|
|
441
|
+
"sha256": "a1413c4af5d854163741e92575fb913b93bdac1c1b7cfc59be8c3e0c8780eac0",
|
|
211
442
|
"tier": "template",
|
|
212
443
|
"overwrite_policy": "merge-3way",
|
|
213
444
|
"preserve_on_uninstall": false
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AcquireError,
|
|
4
4
|
acquireAccessToken,
|
|
5
|
+
decodeJwtPayload,
|
|
6
|
+
getMembershipState,
|
|
5
7
|
loadConfig,
|
|
6
8
|
requireMcpUrl
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Q3BTSXCK.js";
|
|
8
10
|
import "./chunk-4V4QABOJ.js";
|
|
9
11
|
|
|
10
12
|
// src/commands/whoami.ts
|
|
11
|
-
import { Buffer } from "buffer";
|
|
12
|
-
function decodeJwtPayload(jwt) {
|
|
13
|
-
const parts = jwt.split(".");
|
|
14
|
-
if (parts.length !== 3) return null;
|
|
15
|
-
try {
|
|
16
|
-
const json = Buffer.from(parts[1], "base64url").toString("utf8");
|
|
17
|
-
return JSON.parse(json);
|
|
18
|
-
} catch {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
13
|
async function whoamiHandler(opts) {
|
|
23
14
|
const stdout = opts.stdout ?? ((s) => process.stdout.write(s));
|
|
24
15
|
const stderr = opts.stderr ?? ((s) => process.stderr.write(s));
|
|
25
16
|
const exit = opts.exit ?? ((c) => process.exit(c));
|
|
17
|
+
if (opts.json) {
|
|
18
|
+
const state = getMembershipState({
|
|
19
|
+
profile: opts.profile,
|
|
20
|
+
cleargateHome: opts.cleargateHome,
|
|
21
|
+
now: opts.now
|
|
22
|
+
});
|
|
23
|
+
stdout(JSON.stringify(state) + "\n");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
26
|
const cfg = loadConfig({ flags: { profile: opts.profile, mcpUrl: opts.mcpUrlFlag } });
|
|
27
27
|
let mcpUrl;
|
|
28
28
|
try {
|
|
@@ -62,10 +62,10 @@ async function whoamiHandler(opts) {
|
|
|
62
62
|
[
|
|
63
63
|
`mcp_url: ${mcpUrl}`,
|
|
64
64
|
`profile: ${opts.profile}`,
|
|
65
|
-
`member_id: ${claims
|
|
66
|
-
`project_id: ${claims
|
|
67
|
-
`role: ${claims
|
|
68
|
-
`expires_at: ${typeof claims
|
|
65
|
+
`member_id: ${claims["sub"] ?? "?"}`,
|
|
66
|
+
`project_id: ${claims["project_id"] ?? "?"}`,
|
|
67
|
+
`role: ${claims["role"] ?? "?"}`,
|
|
68
|
+
`expires_at: ${typeof claims["exp"] === "number" ? new Date(claims["exp"] * 1e3).toISOString() : "?"}`,
|
|
69
69
|
""
|
|
70
70
|
].join("\n")
|
|
71
71
|
);
|
|
@@ -73,4 +73,4 @@ async function whoamiHandler(opts) {
|
|
|
73
73
|
export {
|
|
74
74
|
whoamiHandler
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=whoami-
|
|
76
|
+
//# sourceMappingURL=whoami-W4U6DPVG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/whoami.ts"],"sourcesContent":["/**\n * cleargate whoami — smoke-test command that proves the stored refresh token\n * can be exchanged for a short-lived MCP access token, decodes the JWT payload\n * (no verification — just introspection), and prints identity fields.\n *\n * CR-011: adds --json mode. When --json flag is present, skip network entirely;\n * call getMembershipState() and emit JSON to stdout. Existing non-JSON path\n * (network whoami) remains unchanged for backward compat.\n *\n * This is the first command to exercise the acquireAccessToken flow end-to-end;\n * sync/pull/push will be wired in follow-up stories.\n */\nimport { loadConfig, requireMcpUrl } from '../config.js';\nimport { acquireAccessToken, AcquireError } from '../auth/acquire.js';\nimport { decodeJwtPayload, getMembershipState } from '../lib/membership.js';\n\nexport interface WhoamiOptions {\n profile: string;\n mcpUrlFlag?: string;\n /** CR-011: emit JSON state instead of making a network call */\n json?: boolean;\n /** Test seam: replaces globalThis.fetch */\n fetch?: typeof globalThis.fetch;\n stdout?: (s: string) => void;\n stderr?: (s: string) => void;\n exit?: (code: number) => never;\n /** Test seam: override ~/.cleargate home path for getMembershipState */\n cleargateHome?: string;\n /** Test seam: override clock for expiry check */\n now?: () => number;\n}\n\nexport async function whoamiHandler(opts: WhoamiOptions): Promise<void> {\n const stdout = opts.stdout ?? ((s) => process.stdout.write(s));\n const stderr = opts.stderr ?? ((s) => process.stderr.write(s));\n const exit = opts.exit ?? ((c: number): never => process.exit(c));\n\n // CR-011: --json mode — cheap-path, no network call.\n if (opts.json) {\n const state = getMembershipState({\n profile: opts.profile,\n cleargateHome: opts.cleargateHome,\n now: opts.now,\n });\n stdout(JSON.stringify(state) + '\\n');\n return;\n }\n\n // Existing network path (backward compat).\n const cfg = loadConfig({ flags: { profile: opts.profile, mcpUrl: opts.mcpUrlFlag } });\n let mcpUrl: string;\n try {\n mcpUrl = requireMcpUrl(cfg);\n } catch (err) {\n stderr(`cleargate: ${err instanceof Error ? err.message : String(err)}\\n`);\n exit(5);\n return;\n }\n\n let accessToken: string;\n try {\n accessToken = await acquireAccessToken({\n mcpUrl,\n profile: opts.profile,\n fetch: opts.fetch,\n });\n } catch (err) {\n if (err instanceof AcquireError) {\n stderr(`cleargate: ${err.message}\\n`);\n exit(err.code === 'transport' ? 2 : 5);\n return;\n }\n stderr(`cleargate: internal error: ${err instanceof Error ? err.message : String(err)}\\n`);\n exit(99);\n return;\n }\n\n const claims = decodeJwtPayload(accessToken);\n if (!claims) {\n stderr('cleargate: access token received but could not decode payload.\\n');\n exit(7);\n return;\n }\n\n stdout(\n [\n `mcp_url: ${mcpUrl}`,\n `profile: ${opts.profile}`,\n `member_id: ${claims['sub'] ?? '?'}`,\n `project_id: ${claims['project_id'] ?? '?'}`,\n `role: ${claims['role'] ?? '?'}`,\n `expires_at: ${typeof claims['exp'] === 'number' ? new Date(claims['exp'] as number * 1000).toISOString() : '?'}`,\n '',\n ].join('\\n'),\n );\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,eAAsB,cAAc,MAAoC;AACtE,QAAM,SAAS,KAAK,WAAW,CAAC,MAAM,QAAQ,OAAO,MAAM,CAAC;AAC5D,QAAM,SAAS,KAAK,WAAW,CAAC,MAAM,QAAQ,OAAO,MAAM,CAAC;AAC5D,QAAM,OAAO,KAAK,SAAS,CAAC,MAAqB,QAAQ,KAAK,CAAC;AAG/D,MAAI,KAAK,MAAM;AACb,UAAM,QAAQ,mBAAmB;AAAA,MAC/B,SAAS,KAAK;AAAA,MACd,eAAe,KAAK;AAAA,MACpB,KAAK,KAAK;AAAA,IACZ,CAAC;AACD,WAAO,KAAK,UAAU,KAAK,IAAI,IAAI;AACnC;AAAA,EACF;AAGA,QAAM,MAAM,WAAW,EAAE,OAAO,EAAE,SAAS,KAAK,SAAS,QAAQ,KAAK,WAAW,EAAE,CAAC;AACpF,MAAI;AACJ,MAAI;AACF,aAAS,cAAc,GAAG;AAAA,EAC5B,SAAS,KAAK;AACZ,WAAO,cAAc,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,CAAI;AACzE,SAAK,CAAC;AACN;AAAA,EACF;AAEA,MAAI;AACJ,MAAI;AACF,kBAAc,MAAM,mBAAmB;AAAA,MACrC;AAAA,MACA,SAAS,KAAK;AAAA,MACd,OAAO,KAAK;AAAA,IACd,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,QAAI,eAAe,cAAc;AAC/B,aAAO,cAAc,IAAI,OAAO;AAAA,CAAI;AACpC,WAAK,IAAI,SAAS,cAAc,IAAI,CAAC;AACrC;AAAA,IACF;AACA,WAAO,8BAA8B,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,CAAI;AACzF,SAAK,EAAE;AACP;AAAA,EACF;AAEA,QAAM,SAAS,iBAAiB,WAAW;AAC3C,MAAI,CAAC,QAAQ;AACX,WAAO,kEAAkE;AACzE,SAAK,CAAC;AACN;AAAA,EACF;AAEA;AAAA,IACE;AAAA,MACE,eAAe,MAAM;AAAA,MACrB,eAAe,KAAK,OAAO;AAAA,MAC3B,eAAe,OAAO,KAAK,KAAK,GAAG;AAAA,MACnC,eAAe,OAAO,YAAY,KAAK,GAAG;AAAA,MAC1C,eAAe,OAAO,MAAM,KAAK,GAAG;AAAA,MACpC,eAAe,OAAO,OAAO,KAAK,MAAM,WAAW,IAAI,KAAK,OAAO,KAAK,IAAc,GAAI,EAAE,YAAY,IAAI,GAAG;AAAA,MAC/G;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cleargate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Planning framework for Claude Code agents — sprint/epic/story protocol, four-agent loop (architect/developer/qa/reporter), Karpathy-style awareness wiki.",
|
|
@@ -20,13 +20,24 @@
|
|
|
20
20
|
"types": "./dist/admin-api/index.d.ts",
|
|
21
21
|
"import": "./dist/admin-api/index.js",
|
|
22
22
|
"require": "./dist/admin-api/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./lib/ledger": {
|
|
25
|
+
"types": "./dist/lib/ledger.d.ts",
|
|
26
|
+
"import": "./dist/lib/ledger.js",
|
|
27
|
+
"require": "./dist/lib/ledger.cjs"
|
|
28
|
+
},
|
|
29
|
+
"./lib/ledger.js": {
|
|
30
|
+
"types": "./dist/lib/ledger.d.ts",
|
|
31
|
+
"import": "./dist/lib/ledger.js",
|
|
32
|
+
"require": "./dist/lib/ledger.cjs"
|
|
23
33
|
}
|
|
24
34
|
},
|
|
25
35
|
"files": [
|
|
26
36
|
"dist",
|
|
27
37
|
"templates",
|
|
28
38
|
"README.md",
|
|
29
|
-
"LICENSE"
|
|
39
|
+
"LICENSE",
|
|
40
|
+
"CHANGELOG.md"
|
|
30
41
|
],
|
|
31
42
|
"engines": {
|
|
32
43
|
"node": ">=24.0.0"
|
|
@@ -17,6 +17,8 @@ Given a sprint milestone (one or more Story files), produce a **single implement
|
|
|
17
17
|
3. **Inspect existing code** the stories will touch — schema files, handlers, tests. Use Grep/Read; do not guess at shape.
|
|
18
18
|
4. **Produce the plan** with this structure:
|
|
19
19
|
|
|
20
|
+
Plan length is scope-driven — there is no line cap. The reform from EPIC-024 is to drop §3.1 duplication, not to compress.
|
|
21
|
+
|
|
20
22
|
```markdown
|
|
21
23
|
# Milestone: <name>
|
|
22
24
|
## Stories: STORY-XXX-YY, STORY-XXX-ZZ
|
|
@@ -27,15 +29,15 @@ Strict ordering if any (A must land before B). Flag parallelizable pairs explici
|
|
|
27
29
|
|
|
28
30
|
## Per-story blueprint
|
|
29
31
|
### STORY-XXX-YY
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
- Test scenarios (from Gherkin): <numbered list, agent must cover all>
|
|
32
|
+
- Cross-story coupling: <which other stories' surfaces does this touch?>
|
|
33
|
+
- Schema changes (verbatim, if any): <migration or frontmatter delta>
|
|
34
|
+
- Test scenarios (from Gherkin): <numbered list — agent must cover all>
|
|
34
35
|
- Reuse (no duplication): <existing helpers/modules to call>
|
|
35
|
-
- Gotchas surfaced from code inspection: <non-obvious stuff>
|
|
36
|
+
- Gotchas surfaced from code inspection: <file:line citations only — non-obvious stuff>
|
|
36
37
|
|
|
37
38
|
## Cross-story risks
|
|
38
|
-
Things a Developer working only on their story might miss
|
|
39
|
+
Things a Developer working only on their story might miss
|
|
40
|
+
(e.g. "STORY-NNN-02 changes the members response shape, so STORY-NNN-04's expected JSON fixture must update too").
|
|
39
41
|
|
|
40
42
|
## Open decisions for orchestrator
|
|
41
43
|
Things you will NOT decide — flag them up.
|
|
@@ -137,12 +139,12 @@ Before emitting a `lane` recommendation per story during Sprint Design Review, r
|
|
|
137
139
|
|
|
138
140
|
**Sprint Design Review tail step:** After running the rubric on each story, emit `lane: standard|fast` per story in the §1 story table. For every non-`standard` lane, emit a one-line rationale (≤80 chars). Architect MUST write a `## §2.4 Lane Audit` subsection in the Sprint Plan listing every fast-lane story with a ≤80-char rationale. Empty by default — rows added only for non-`standard` lanes.
|
|
139
141
|
|
|
140
|
-
Full rubric, demotion mechanics, and forbidden-surface table are in
|
|
142
|
+
Full rubric, demotion mechanics, and forbidden-surface table are in `cleargate-enforcement.md` §9 "Lane Routing". These rules apply under `execution_mode: v2`.
|
|
141
143
|
|
|
142
144
|
## Guardrails
|
|
143
145
|
- **No production code.** You write one markdown plan file. Nothing else.
|
|
144
146
|
- **No speculation.** Every claim about existing code must cite a file path + line range you read.
|
|
145
|
-
- **
|
|
147
|
+
- **Plan length is scope-driven.** No line cap. The reform from EPIC-024 was to drop §3.1 duplication, not to compress.
|
|
146
148
|
- **No hedging language** ("consider", "might want to", "perhaps"). State the decision; the Developer executes it.
|
|
147
149
|
|
|
148
150
|
## What you are NOT
|