gm-cc 2.0.545 → 2.0.547

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.
@@ -4,7 +4,7 @@
4
4
  "name": "AnEntrypoint"
5
5
  },
6
6
  "description": "State machine agent with hooks, skills, and automated git enforcement",
7
- "version": "2.0.545",
7
+ "version": "2.0.547",
8
8
  "metadata": {
9
9
  "description": "State machine agent with hooks, skills, and automated git enforcement"
10
10
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-cc",
3
- "version": "2.0.545",
3
+ "version": "2.0.547",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.545",
3
+ "version": "2.0.547",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": {
6
6
  "name": "AnEntrypoint",
@@ -17,11 +17,28 @@ Transitions = state changes, not reminders. Phase exit condition met → next Sk
17
17
 
18
18
  `gm-execute` = execution contract. Defines "running code" across every phase: `exec:<lang>` = only runner; `exec:codesearch` = only exploration; witnessed output = only ground truth; import real modules over reimplementation. Execution happens in every phase, not only EXECUTE. About to run anything, `gm-execute` protocols not fresh in context → operating outside contract → reload `gm-execute` first.
19
19
 
20
- ## FRAGILE LEARNINGS
20
+ ## FRAGILE LEARNINGS — HARD RULE
21
21
 
22
- Every fact resolved this session lives only in current context. Context compacts. Sessions end. Next agent starts blind. `memorize` subagent = handoff. One background call per fact at moment of resolution. Non-blocking; work continues. Worth memorizing: API shapes, environment quirks, timeouts, user preferences, build cadences, CI behaviors — facts that would have saved today's time if in memory at start.
22
+ Every unknown→known transition in this session = fact that dies on compaction unless handed off **the same turn it resolves**. Not end of phase. Not end of chain. Same turn.
23
23
 
24
- Resolve a mutable, skip memorize = forget on purpose.
24
+ **Automatic trigger** spawn `memorize` the moment any of these happens:
25
+ - An `exec:` run's output answers an earlier "let me check" / "I don't know yet"
26
+ - A code read confirms or refutes an assumption
27
+ - A CI log reveals a root cause
28
+ - User states a preference, constraint, deadline, or decision
29
+ - A fix worked for a non-obvious reason
30
+ - A tool / environment quirk bit once (blocked commands, path oddities, platform gotchas)
31
+
32
+ **Invocation** (background, non-blocking, continue working in the same message):
33
+ ```
34
+ Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<single fact with enough context to be useful cold>')
35
+ ```
36
+
37
+ **Parallel**: multiple facts resolve in one turn → spawn multiple memorize agents in the **same message** (parallel tool blocks). One call per fact. Never serialize, never batch into one prompt.
38
+
39
+ **End-of-turn self-check** (mandatory before handing control back): scan the turn for resolved unknowns that were not memorized. Any found → spawn them now, parallel, before the response closes.
40
+
41
+ Resolve an unknown, skip memorize = memory leak. Treat it as a bug, not a style choice.
25
42
 
26
43
  ## USER DONE TALKING
27
44
 
@@ -23,14 +23,16 @@ Failing test, red CI, surprising downstream cascade ≠ things to patch around.
23
23
 
24
24
  Let chain carry you. Stop-and-fix-here = how silent-failure bugs reach prod. Machine assumes you regress; trust it.
25
25
 
26
- ## FRAGILE LEARNINGS
26
+ ## FRAGILE LEARNINGS — HARD RULE
27
27
 
28
- Phase where environment reality hits hardest — CI runner quirks, flaky-test patterns, timing thresholds, deploy cadences, cross-repo cascade behaviors. These facts most reward future sessions. Each → memorize call, one per fact, non-blocking, at moment of resolution:
28
+ Phase where environment reality hits hardest — CI runner quirks, flaky-test patterns, timing thresholds, deploy cadences, cross-repo cascade behaviors. Highest-value memorization surface. Each fact → memorize **the same turn it resolves**, background, parallel when multiple:
29
29
 
30
30
  ```
31
31
  Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<fact>')
32
32
  ```
33
33
 
34
+ One call per fact. **End-of-turn self-check** mandatory: any resolved unknown un-memorized → spawn before closing response. Full trigger contract in `planning` / `gm-execute`.
35
+
34
36
  ## TRANSITIONS
35
37
 
36
38
  **EXIT — .gm/prd.yml items remain**: Verified items completed, .gm/prd.yml still has pending items → invoke `gm-execute` skill immediately (next wave). Do not stop.
@@ -26,15 +26,15 @@ Post-emit divergence from pre-emit baseline:
26
26
 
27
27
  Urge to "just fix real quick" = signal mutable map was incomplete. Trust state machine: regress to correct phase, resolve, return.
28
28
 
29
- ## FRAGILE LEARNINGS
29
+ ## FRAGILE LEARNINGS — HARD RULE
30
30
 
31
- Pre-emit and post-emit runs surface facts you lacked: actual function signatures, edge-case return values, adjacent-module interactions, hidden invariants. Each dies on context compaction unless handed off.
31
+ Pre-emit and post-emit runs surface facts you lacked: actual function signatures, edge-case return values, adjacent-module interactions, hidden invariants. Each dies on compaction unless memorized **the same turn it resolves** — not at phase exit.
32
32
 
33
33
  ```
34
- Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<fact witnessed this phase>')
34
+ Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<fact>')
35
35
  ```
36
36
 
37
- One call per fact, non-blocking, at moment of resolution.
37
+ One call per fact, background, parallel when multiple resolve together. **End-of-turn self-check**: scan for un-memorized resolutions before closing response; spawn any missed. Same enforcement as `planning` / `gm-execute` — see those skills for the full trigger contract.
38
38
 
39
39
  ## TRANSITIONS
40
40
 
@@ -138,17 +138,27 @@ Real services, real data, real timing. Mocks/fakes/stubs/simulations = diagnosti
138
138
 
139
139
  **CODE QUALITY PROCESS**: The goal is minimal code / maximal DX. When writing or reviewing any block of code, run this mental process: (1) What native language/platform feature already does this? Use it. (2) What library already solves this pattern? Use it. (3) Can this branch/loop be a data structure — a map, array, or pipeline — where the structure itself enforces correctness? Make it so. (4) Would a newcomer read this top-to-bottom and immediately understand what it does without running it? If no, restructure. One-liners that compress logic are the opposite of DX — clarity comes from structure, not brevity. Dispatch tables, pipeline chains, and native APIs eliminate entire categories of bugs by making wrong states unrepresentable.
140
140
 
141
- ## FRAGILE LEARNINGS
141
+ ## FRAGILE LEARNINGS — HARD RULE
142
142
 
143
- Every UNKNOWN→KNOWN transition = fact living only in current context. Session ends. Next agent starts blind. `memorize` subagent = only bridge. One background call per fact at moment of resolution:
143
+ Every UNKNOWN→KNOWN transition during execution = fact that dies on compaction. The memorize spawn is **not** end-of-phase cleanup it fires **the same turn the fact resolves**, before the next tool call if possible, end-of-turn at latest.
144
144
 
145
+ **Trigger contract** (any = fire):
146
+ - `exec:` output resolves a prior "let me check" / "does this API take X" / "what version is installed"
147
+ - CI log or error output reveals a root cause
148
+ - Code read confirms or refutes an assumption about existing structure
149
+ - Environment / tooling quirk observed (blocked commands, platform-specific behavior, path resolution)
150
+ - User states a preference, constraint, deadline, or judgment call
151
+
152
+ **Invocation** (one per fact, background, parallel when multiple):
145
153
  ```
146
- Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<resolved fact>')
154
+ Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<fact with enough context for a cold-start agent>')
147
155
  ```
148
156
 
149
- Non-blocking; work continues. Highest-value facts = ones that would have saved today's time if in memory at start: API shapes resolved by import-and-witness, environment quirks, runtime constraints, user-stated preferences, project-specific cadences. Resolve a mutable, skip memorize = forget on purpose.
157
+ **Parallel spawn**: N facts resolved in one turn N memorize calls in a **single message**, parallel tool blocks. Never serialize. Never merge multiple facts into one prompt.
158
+
159
+ **End-of-turn self-check** (mandatory): before the response closes, scan the turn for resolved unknowns that were not memorized. Missed one → spawn now. No exceptions — a resolved unknown leaving the turn without handoff is a memory leak.
150
160
 
151
- Self-check: after any witnessed run that resolved something, next action = another witnessing run (more mutables) OR `Agent` memorize call (fact was memorable). Neither = something evaporated.
161
+ Skip memorize = forget on purpose. Treat it as a bug.
152
162
 
153
163
  ## DO NOT STOP
154
164
 
@@ -22,14 +22,32 @@ Output of this phase ≠ task list. Output = enumeration of every fault surface
22
22
 
23
23
  Patch-around-unknowns-in-place = compounding silent-failure debt. Regress early = stay inside contract.
24
24
 
25
- ## FRAGILE LEARNINGS
25
+ ## FRAGILE LEARNINGS — MEMORIZE ON RESOLUTION (HARD RULE)
26
26
 
27
- Every mutable resolved here (existingImpl absent, dep version confirmed, user constraint stated, build quirk observed) = fact that dies on context compaction unless handed off. `memorize` subagent = handoff. One background call per fact at moment of resolution. Non-blocking; continue.
27
+ Every unknown resolved in any phase (existingImpl absent, dep version confirmed, API shape witnessed, env quirk observed, CI failure root-caused, build flag required, user preference stated) = fact that dies on context compaction unless handed off. Not optional. Not batched at end. **Memorize at the moment of resolution, before the next tool call.**
28
28
 
29
+ **Trigger contract — memorize fires when ANY of these occur**:
30
+ - An `exec:` run produces output that answers a prior "I don't know" / "let me check"
31
+ - A code read confirms or refutes an assumption about existing structure
32
+ - A CI log reveals the root cause of a failure
33
+ - User states a preference, constraint, deadline, or decision
34
+ - A fix works and the reason it worked is non-obvious (would be forgotten next session)
35
+ - An environment / tooling quirk bites once (blocked tools, path oddities, platform differences)
36
+
37
+ **Enforcement**:
38
+ - Regardless of phase, a resolved unknown → spawn `memorize` subagent **in the same turn** as the resolution. Do not wait for phase end. Do not batch across multiple facts — one call per fact keeps classification clean.
39
+ - Run in background (`run_in_background=true`). Non-blocking. Continue work in the same message.
40
+ - If you notice at end of turn that an unknown resolved earlier was not memorized, spawn it now. Catching up is allowed. Skipping is not.
41
+
42
+ **Invocation (copy verbatim, substitute the fact)**:
29
43
  ```
30
- Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<single resolved fact>')
44
+ Agent(subagent_type='memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<single resolved fact with enough context for a cold-start agent to use it>')
31
45
  ```
32
46
 
47
+ **Parallelization**: multiple unknowns resolved in one turn → spawn multiple memorize agents in the **same message** (parallel tool blocks). Never serialize them.
48
+
49
+ **Violations = memory leak**. If you leave the turn with a resolved unknown un-memorized, the fact is gone on next compaction. That is the failure mode this rule prevents. Treat every exit from a turn without memorize-catch-up as a bug.
50
+
33
51
  ## STATE MACHINE
34
52
 
35
53
  **FORWARD**: PLAN complete → `gm-execute` | EXECUTE complete → `gm-emit` | EMIT complete → `gm-complete` | VERIFY .prd remains → `gm-execute` | VERIFY .prd empty+pushed → `update-docs`
@@ -192,6 +210,6 @@ Auto-Clarity: drop caveman for security warnings, irreversible confirmations, am
192
210
  **Tier 2**: no_duplication, no_hardcoded_values, modularity
193
211
  **Tier 3**: no_comments, convention_over_code
194
212
 
195
- **Never**: `Bash(node/npm/npx/bun)` | skip planning | partial execution | stop while .gm/prd.yml has items | stop while git dirty | sequential independent items | screenshot before JS exhausted | fallback/demo modes | silently swallow errors | duplicate concern | leave comments | create scattered test files (only root test.js) | write if/else chains where a map or pipeline suffices | write one-liners that require decoding | branch on enumerated cases when a dispatch table exists
213
+ **Never**: `Bash(node/npm/npx/bun)` | skip planning | partial execution | stop while .gm/prd.yml has items | stop while git dirty | sequential independent items | screenshot before JS exhausted | fallback/demo modes | silently swallow errors | duplicate concern | leave comments | create scattered test files (only root test.js) | write if/else chains where a map or pipeline suffices | write one-liners that require decoding | branch on enumerated cases when a dispatch table exists | **leave a resolved unknown un-memorized** | batch memorize calls until end of turn | serialize parallel memorize spawns
196
214
 
197
- **Always**: invoke named skill at every state transition | regress to planning on any new unknown | witnessed execution only | scan codebase before edits | enumerate every possible observability improvement every planning pass | follow skill chain completely end-to-end on every task without exception | prefer dispatch tables over switch/if chains | prefer pipelines over loop-with-accumulator | make wrong states structurally impossible | name patterns when structure eliminates a whole class of bugs
215
+ **Always**: invoke named skill at every state transition | regress to planning on any new unknown | witnessed execution only | scan codebase before edits | enumerate every possible observability improvement every planning pass | follow skill chain completely end-to-end on every task without exception | prefer dispatch tables over switch/if chains | prefer pipelines over loop-with-accumulator | make wrong states structurally impossible | name patterns when structure eliminates a whole class of bugs | **spawn `memorize` the same turn an unknown resolves** | parallel-spawn one memorize per fact when multiple resolve together | end-of-turn self-check: any resolved unknowns un-memorized? → spawn now before handing control back