Skip to content
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
efd65be
merge: sync upstream main for schema consolidation bias fix
dgrant Apr 17, 2026
abafb38
fix: counter model-design bias toward fewer tables and JSONField shor…
dgrant Apr 17, 2026
e201a75
chore: regenerate SKILL.md after merging main
dgrant Apr 18, 2026
27dd622
merge: sync upstream main (v1.1.1.0)
dgrant Apr 18, 2026
63d29e4
chore: bump version and changelog (v1.1.2.0)
dgrant Apr 18, 2026
fe3f0d6
merge: sync upstream main (v1.60.2.0)
dgrant Jul 16, 2026
5374987
fix(plan-eng-review,plan-ceo-review): narrow absolute schema-bias lan…
dgrant Jul 16, 2026
33fbb58
test: resolve terminology drift, rebase E2E fixture to carved templat…
dgrant Jul 16, 2026
d756745
chore: drop mid-branch VERSION/CHANGELOG bump
dgrant Jul 16, 2026
09ad6fb
fix: harden new data-model eval regexes, dedupe E2E fixture setup
dgrant Jul 16, 2026
a9124bd
test: add minimal-change counterexample eval, unit-test matchesUnnegated
dgrant Jul 16, 2026
aa49339
fix: widen matchesUnnegated to sentence boundary, catch contrastive p…
dgrant Jul 16, 2026
b3acffd
fix: catch can't/won't-style contractions, guard data-model-bias agai…
dgrant Jul 16, 2026
02e312c
fix: harden data-model E2E fixtures against reading the operator's re…
dgrant Jul 16, 2026
1820f58
fix: drop bare "no" as a negation trigger, treat markdown bullets as …
dgrant Jul 16, 2026
c58e1b0
chore: bump version and changelog (v1.61.0.0)
dgrant Jul 16, 2026
f3c5407
docs: clarify new E2E evals are scoped to /plan-eng-review only
dgrant Jul 16, 2026
54a50e4
fix(plan-eng-review,plan-ceo-review): trim scope per PR review — drop…
dgrant Jul 16, 2026
b39da77
test: simplify matchesUnnegated, drop its dedicated unit test file
dgrant Jul 16, 2026
72cae55
docs: update CHANGELOG and TODOS to match the trimmed scope
dgrant Jul 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## [1.61.0.0] - 2026-07-16

## **`/plan-eng-review` and `/plan-ceo-review` stop pushing you toward fewer tables and JSONField shortcuts — without swinging to the opposite extreme.**

Both skills' "right-sized diff" preference was quietly biased against schema normalization: adding a new model touches more files than adding a column, so reviewers kept steering people toward merging new fields into existing tables and reaching for JSONField as a polymorphism shortcut. This release adds an explicit data-model exception — normalize first, denormalize when you have a measured reason — plus a full "Data model review checklist" in `/plan-eng-review`'s Architecture Review (SRP, nullable-semantic smells, hidden polymorphism, FK deletion strategy, and seven more). Early feedback flagged the fix as too absolute in the other direction, so this release also adds explicit counterexamples: legitimate JSONField uses (caching a third-party webhook payload verbatim, an open-ended preference bag), denormalization backed by a real measurement (a profiled hot path, a load test), and the case where keeping a single trivial field inline is genuinely the right, minimal call.

### What this means for you

Ask `/plan-eng-review` to review a schema change and it will push back on merging polymorphic data into an existing model or reaching for JSONField when the variants are already known — but it will also recognize when JSONField is the correct choice (a verbatim third-party payload cache), when denormalizing is justified (you've measured the bottleneck), and when a single new field genuinely doesn't need its own table.

### Itemized changes

#### Changed
- `/plan-eng-review` and `/plan-ceo-review`: added a "data model exception to right-sized diff" — normalize first, denormalize for a measured reason, don't split reflexively when a field has no independent query pattern or consumer.
- `/plan-eng-review` and `/plan-ceo-review`: added explicit JSONField guidance — not an escape hatch for known, stable polymorphism, but legitimately fine for third-party payload caches, open-ended preference bags, and schemas still being discovered.
- `/plan-eng-review`: Architecture Review gained a "Data model honesty" check and a full Data Model Review Checklist (11 proactive checks) that runs on every model touched by a plan, instead of waiting for the user to push back on model shape.
- `/plan-eng-review`: three new cognitive patterns (normalize-first, SRP-for-data-models, structure-beats-blobs-for-known-polymorphism).

#### For contributors
- New periodic-tier E2E evals, all against `/plan-eng-review` (not yet `/plan-ceo-review` — tracked as a follow-up in TODOS.md), exercising all three review-feedback categories end-to-end: a plan that should trigger pushback (polymorphic data inlined with JSONField), one that shouldn't (a legitimate third-party payload cache), one testing measured denormalization is accepted, and one testing a minimal single-field addition isn't over-split.
- New free unit tests for the negation-aware text matcher these evals rely on (`test/helpers/e2e-helpers.test.ts`), covering sentence-boundary scanning, curly-apostrophe contractions, contrastive phrasing ("rather than"/"instead of"), and markdown-bullet clause boundaries — all real gaps found across four rounds of specialist and adversarial review during this branch's own `/ship`.
- Extracted shared E2E fixture setup (`setupPlanEngReviewFixture`) and a hermetic, absolute-path-pinned prompt builder (`planEngReviewDataModelPrompt`) so these new tests can't accidentally grade against a machine's globally-installed skill instead of the branch under test.

## [1.60.1.0] - 2026-07-09

## **The /autoplan dual-voice eval is back on the board, catching real regressions.**
Expand Down
13 changes: 13 additions & 0 deletions TODOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,19 @@ scope of that PR; deliberately deferred to keep PTY-import small.

## Testing

## P2: /plan-ceo-review data-model-bias behavioral E2E coverage

**What:** The v1.61.0.0 schema-consolidation-bias fix (garrytan/gstack#1048) added the same two data-model preference bullets ("right-sized diff" exception + "JSONField not an escape hatch") to both `/plan-eng-review` and `/plan-ceo-review`, but the four new periodic-tier E2E evals (`plan-eng-review-data-model-{bias,legitimate-json,measured-denorm,minimal-change}`) only drive `/plan-eng-review`. `/plan-ceo-review`'s copy of the same bullets has zero behavioral test coverage — only the static grep guardrail in `test/skill-validation.test.ts` confirms the text still exists.

**Why:** `/plan-ceo-review` runs a materially different workflow (SCOPE EXPANSION / SELECTIVE EXPANSION / HOLD SCOPE modes, its own `sections/review-sections.md`) — identical prose is no guarantee the model actually applies the bias fix the same way it does in `/plan-eng-review`. `touchfiles.ts` doesn't map any test to a change in these bullets for plan-ceo-review, so a regression there would go unnoticed by diff-based test selection entirely. Flagged by the ship-workflow coverage audit during this branch's own `/ship` run.

**Context:** Mirror the four `plan-eng-review-data-model-*` blocks in `test/skill-e2e-plan.test.ts` for plan-ceo-review — same synthetic plans, same `setupPlanEngReviewFixture`-style hermetic fixture (would need a `plan-ceo-review` variant), same `matchesUnnegated`-guarded regex assertions. plan-ceo-review's HOLD SCOPE mode is the simplest one that still exercises the Architecture Review, per the pattern already used in `test/skill-e2e-plan-ceo-review-section-loading.test.ts`.

**Priority:** P2.
**Effort:** M (human: ~half day / CC: ~1-2h — mostly copy-adapt of the existing plan-eng-review blocks).

---

## P2: Per-finding AskUserQuestion count assertion for /plan-ceo-review

**What:** PTY E2E test that drives /plan-ceo-review through Step 0 with a stable fixture diff containing N known findings, asserts that exactly N distinct AskUserQuestions fire (one per finding) before plan_ready.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.60.1.0
1.61.0.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gstack",
"version": "1.60.1.0",
"version": "1.61.0.0",
"description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 2 additions & 0 deletions plan-ceo-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,8 @@ Do NOT make any code changes. Do NOT start implementation. Your only job right n
* I err on the side of handling more edge cases, not fewer; thoughtfulness > speed.
* Bias toward explicit over clever.
* Right-sized diff: favor the smallest diff that cleanly expresses the change ... but don't compress a necessary rewrite into a minimal patch. If the existing foundation is broken, invoke permission #9 and say "scrap it and do this instead."
* **Data model exception to "right-sized diff": for schema and model changes, don't let diff size alone decide the shape.** Normalize first; denormalize when you have a measured reason — a profiled hot path, a load test, a documented query-plan cost — and say so in the plan. Splitting a model that's doing two unrelated jobs into two clean models is usually worth the extra table, but it's a judgment call, not an automatic rule: if the "split" model would only ever be read through one FK join, written by exactly one code path, and queried by nothing else, keeping it inline can be the right, deliberate choice too. When tempted to merge new fields into an existing model purely to reduce table count, ask: "does each model have exactly one job?" If splitting is honest, split; if the fields genuinely belong to the same concept, don't split just to look normalized. Count concepts, not tables.
* **JSONField is not an escape hatch for polymorphism.** When tempted to add a JSONField/HStoreField/payload column to encode variant-specific data (different keys for different kinds) that you can already enumerate and expect to stay stable, promote it to explicit columns instead. JSONField loses FK enforcement, cascade/protect behavior, CheckConstraints on shape, queryability, type system, and self-documentation. Diagnostic: if you find yourself documenting "what keys appear in this JSONField for which variant," you have schema, you just put it in a place where the DB can't help you. This isn't a blanket ban on JSON columns — legitimate uses are common: caching a third-party API's response verbatim (Stripe webhook payloads, OAuth provider profiles), a genuinely open-ended user-preferences bag nobody queries into, event/analytics payloads shaped by an external producer, or a schema still being discovered (variants that aren't stable yet — revisit once they are). Polymorphism with knowable, stable variants belongs in explicit columns + CheckConstraints; polymorphism you don't control or haven't discovered yet can legitimately stay in JSON.
* Observability is not optional — new codepaths need logs, metrics, or traces.
* Security is not optional — new codepaths need threat modeling.
* Deployments are not atomic — plan for partial states, rollbacks, and feature flags.
Expand Down
2 changes: 2 additions & 0 deletions plan-ceo-review/SKILL.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Do NOT make any code changes. Do NOT start implementation. Your only job right n
* I err on the side of handling more edge cases, not fewer; thoughtfulness > speed.
* Bias toward explicit over clever.
* Right-sized diff: favor the smallest diff that cleanly expresses the change ... but don't compress a necessary rewrite into a minimal patch. If the existing foundation is broken, invoke permission #9 and say "scrap it and do this instead."
* **Data model exception to "right-sized diff": for schema and model changes, don't let diff size alone decide the shape.** Normalize first; denormalize when you have a measured reason — a profiled hot path, a load test, a documented query-plan cost — and say so in the plan. Splitting a model that's doing two unrelated jobs into two clean models is usually worth the extra table, but it's a judgment call, not an automatic rule: if the "split" model would only ever be read through one FK join, written by exactly one code path, and queried by nothing else, keeping it inline can be the right, deliberate choice too. When tempted to merge new fields into an existing model purely to reduce table count, ask: "does each model have exactly one job?" If splitting is honest, split; if the fields genuinely belong to the same concept, don't split just to look normalized. Count concepts, not tables.
* **JSONField is not an escape hatch for polymorphism.** When tempted to add a JSONField/HStoreField/payload column to encode variant-specific data (different keys for different kinds) that you can already enumerate and expect to stay stable, promote it to explicit columns instead. JSONField loses FK enforcement, cascade/protect behavior, CheckConstraints on shape, queryability, type system, and self-documentation. Diagnostic: if you find yourself documenting "what keys appear in this JSONField for which variant," you have schema, you just put it in a place where the DB can't help you. This isn't a blanket ban on JSON columns — legitimate uses are common: caching a third-party API's response verbatim (Stripe webhook payloads, OAuth provider profiles), a genuinely open-ended user-preferences bag nobody queries into, event/analytics payloads shaped by an external producer, or a schema still being discovered (variants that aren't stable yet — revisit once they are). Polymorphism with knowable, stable variants belongs in explicit columns + CheckConstraints; polymorphism you don't control or haven't discovered yet can legitimately stay in JSON.
Comment thread
dgrant marked this conversation as resolved.
Resolved
* Observability is not optional — new codepaths need logs, metrics, or traces.
* Security is not optional — new codepaths need threat modeling.
* Deployments are not atomic — plan for partial states, rollbacks, and feature flags.
Expand Down
15 changes: 10 additions & 5 deletions plan-eng-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,8 @@ If the user asks you to compress or the system triggers context compaction: Step
* I err on the side of handling more edge cases, not fewer; thoughtfulness > speed.
* Bias toward explicit over clever.
* Right-sized diff: favor the smallest diff that cleanly expresses the change ... but don't compress a necessary rewrite into a minimal patch. If the existing foundation is broken, say "scrap it and do this instead."
* **Data model exception to "right-sized diff": for schema and model changes, don't let diff size alone decide the shape.** Normalize first; denormalize when you have a measured reason — a profiled hot path, a load test, a documented query-plan cost — and say so in the plan. Splitting a model that's doing two unrelated jobs into two clean models is usually worth the extra table, but it's a judgment call, not an automatic rule: if the "split" model would only ever be read through one FK join, written by exactly one code path, and queried by nothing else, keeping it inline can be the right, deliberate choice too. When tempted to merge new fields into an existing model purely to reduce table count, ask: "does each model have exactly one job?" If splitting is honest, split; if the fields genuinely belong to the same concept, don't split just to look normalized. Count concepts, not tables.
* **JSONField is not an escape hatch for polymorphism.** When tempted to add a JSONField/HStoreField/payload column to encode variant-specific data (different keys for different kinds) that you can already enumerate and expect to stay stable, promote it to explicit columns instead. JSONField loses FK enforcement, cascade/protect behavior, CheckConstraints on shape, queryability, type system, and self-documentation. Diagnostic: if you find yourself documenting "what keys appear in this JSONField for which variant," you have schema, you just put it in a place where the DB can't help you. This isn't a blanket ban on JSON columns — legitimate uses are common: caching a third-party API's response verbatim (Stripe webhook payloads, OAuth provider profiles), a genuinely open-ended user-preferences bag nobody queries into, event/analytics payloads shaped by an external producer, or a schema still being discovered (variants that aren't stable yet — revisit once they are). Polymorphism with knowable, stable variants belongs in explicit columns + CheckConstraints; polymorphism you don't control or haven't discovered yet can legitimately stay in JSON.

## Cognitive Patterns — How Great Eng Managers Think

Expand All @@ -849,11 +851,14 @@ These are not additional checklist items. They are the instincts that experience
8. **Org structure IS architecture** — Conway's Law in practice. Design both intentionally (Skelton/Pais, Team Topologies).
9. **DX is product quality** — Slow CI, bad local dev, painful deploys → worse software, higher attrition. Developer experience is a leading indicator.
10. **Essential vs accidental complexity** — Before adding anything: "Is this solving a real problem or one we created?" (Brooks, No Silver Bullet).
11. **Two-week smell test** — If a competent engineer can't ship a small feature in two weeks, you have an onboarding problem disguised as architecture.
12. **Glue work awareness** — Recognize invisible coordination work. Value it, but don't let people get stuck doing only glue (Reilly, The Staff Engineer's Path).
13. **Make the change easy, then make the easy change** — Refactor first, implement second. Never structural + behavioral changes simultaneously (Beck).
14. **Own your code in production** — No wall between dev and ops. "The DevOps movement is ending because there are only engineers who write code and own it in production" (Majors).
15. **Error budgets over uptime targets** — SLO of 99.9% = 0.1% downtime *budget to spend on shipping*. Reliability is resource allocation (Google SRE).
11. **Normalize first, denormalize for measured reasons** — Codd's normal forms (1970) and Knuth's "premature optimization is the root of all evil" (1974) both apply directly to schema design. Denormalizing without measurement is exactly what Knuth warned against — denormalizing WITH a measurement (a profiled query, a load test, an explicit latency budget) is exactly what the same principle allows. "Make it work, make it right, make it fast" (Beck) — right shape comes BEFORE fast, but once you've measured that a specific join is the bottleneck, denormalizing that one relationship IS the "make it fast" step working as intended, not a violation.
12. **Single Responsibility Principle applies to data models** — A model that's doing audit + balance + notifications is failing SRP. A model that has fields that are only meaningful when other fields have specific values is failing SRP via hidden polymorphism. Split until each model has exactly one job (Martin, Clean Architecture; Codd, normal forms) — unless the "extra job" is a single trivial field with no independent query pattern or lifecycle, in which case call out the tradeoff rather than mandating a split.
13. **Structure beats blobs for known polymorphism** — If you can enumerate the variants of a thing at design time AND expect that enumeration to stay stable, encode them as explicit columns + CheckConstraints, not as a JSONField/payload bag. The DB can enforce FK integrity, shape constraints, and indexing on columns; it can't on JSON paths. This cuts the other way for polymorphism you don't yet control: third-party blobs, opaque user preferences, and schemas still being discovered are legitimately JSONField. The target is "we know there are 4 kinds and each kind has different fields," not "we don't yet know what shape this will take."
14. **Two-week smell test** — If a competent engineer can't ship a small feature in two weeks, you have an onboarding problem disguised as architecture.
15. **Glue work awareness** — Recognize invisible coordination work. Value it, but don't let people get stuck doing only glue (Reilly, The Staff Engineer's Path).
16. **Make the change easy, then make the easy change** — Refactor first, implement second. Never structural + behavioral changes simultaneously (Beck).
17. **Own your code in production** — No wall between dev and ops. "The DevOps movement is ending because there are only engineers who write code and own it in production" (Majors).
18. **Error budgets over uptime targets** — SLO of 99.9% = 0.1% downtime *budget to spend on shipping*. Reliability is resource allocation (Google SRE).

When evaluating architecture, think "boring by default." When reviewing tests, think "systems over heroes." When assessing complexity, ask Brooks's question. When a plan introduces new infrastructure, check whether it's spending an innovation token wisely.

Expand Down
Loading
Loading