Skip to content

Commit 78bc759

Browse files
MendixMauclaude
andauthored
chore(skills, agent stubs): dedupe rules into pointers (audit part 2/2) (#393)
Seven duplicated rules (pairs 6, 7, 8, 9, 11, 12, 13 from the authoring audit) become pointers to their single source; stronger wording merged into the source first. Restores the nine dropped (§N) refs in the declared architect-agent mirror. Baseline 73,522 -> 73,475 words. Review: independent review MERGE-AFTER-FIX — no rule content lost (every pointer target verified to hold the removed text); fixes in 119dfb7: Behaviour row now "NOT RUN: <reason>" per RELEASE-PROCESS 4a (Trace rules still named inline in the test stub; full text in testing-shape.md, baseline for test at stages 5-6), no-op caveat restored to the test stub. Known pre-existing gap noted: architect mirror lacks workflow rule row 12. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
1 parent 24fe336 commit 78bc759

10 files changed

Lines changed: 26 additions & 55 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
2121

2222
- new(tests/behaviour): **a standing behaviour suite for agent-read text: arms M (base ref), T (candidate ref, or the base minus one skill for an ablation) and N (no pack), two drafting tasks with planted STOP-row requests and five retrieval probes, scored mechanically.** `tests/behaviour/build-packs.sh` builds a pack from any ref in a temporary worktree; `score.sh` adds `read_all` (the agent quoted the pack's `PACK-END` line back), `tool_calls` and `tokens`, and treats `mxcli check` as optional (NA without a binary). `RUNBOOK.md` has the triggers (every PR that changes baseline-routed text or an agent stub; N and ablations at each release cut), 5 reps x 2 tasks plus 5 probes x 3 reps, the rule (T no worse than M on every scored metric, probes T >= M - 1), and partial reads counted and re-run, never dropped. `docs/RELEASE-PROCESS.md` §4a names it as the way to run the Behaviour A/B. Field runs committed under `tests/behaviour/results/`: the 2026-10-15 stub-diet A/B (#369/#378/#380, 42 reps, 3 partial reads on the 4,822-line pack) and the first no-pack run (page trap refused 0/5 without a pack against 5/5 with either; mf passes check 1/5 against 5/5; every arm, N included, also inherited the host session's project CLAUDE.md (a generic mxcli/MDL guide), so N measures 'no toolkit rules', not 'no guidance'). Golden input: four real agent outputs, `tests/wave2/test-behaviour-score.sh`. — maintainer request (MendixMau)
2323
- process(pr-template, release-process): **every Direct-lane PR and every review fills a five-row Impact block: Process, Dependencies, Context cost, Behaviour, Runtime.** "none" or "NOT RUN: <reason>" is legal, a blank row is not. Context cost is pasted from `bin/render-routing.sh --check` on base and head, never estimated; a missing or estimated row is a review finding. The Behaviour A/B (`process/preflight-skill-baseline-2026-08-31.md`) is required for baseline-routed text and agent stubs, recommended for situational skills, NOT RUN with a reason for process docs review agents read, n/a for scripts only; Context cost may be "none" when no routed or always-loaded file is touched. `docs/RELEASE-PROCESS.md` §4a holds the rule and a bad/good example; `CONTRIBUTING.md`'s reviewer list points there. No CI check: `bin/check-pr-discipline.sh` reads the git diff, not the PR body. Field evidence: three PRs reviewed on 2026-10-15 with no process cost stated (#375 added a human step per re-baseline, #384 adds 1–11 s per exec), both found by chance. — maintainer request, MendixMau
24+
- chore(skills, agent stubs): **seven more duplicated rules become pointers to their single source** (CLAUDE.md: "single source of the rule; every other mention defers here"). `existing-app-assurance.md` (main.scss compiles last) and `design-artifacts.md` (tokens in `design-system.html`) point at `learned-stylegallery.md`; `testing-shape.md` §4's dormant-design-system row points at `design-artifacts.md` (which gains "it reads identically either way"); `tool-output-is-not-ground-truth.md`'s git-hash antidote points at `mpr-corruption-and-sp-load-errors.md` RULE 3; `full-harness-audit.md` §3's rung table and `harness-architecture.md` §6's rung 6/7 paragraph point at `journey-proof.md` (which gains "do not merge them into one 1–7 table"); the test-agent stub's two Trace rules point at `testing-shape.md` §4, whose Trace row gains the stub's stronger wording (handler swallowed a real failure; a page renders fine over a dead integration). The architect-agent stub's declared mirror of `workflow-structure-rules.md` §12 gets its dropped `(§N)` references back (+9 words, the only growth). Baseline 73,522 → 73,475 words (−47); test-agent stub −87 words (the no-op caveat stays inline). — authoring audit, maintainer request
2425
- learn(learned-detection-gaps, testing-shape, ui-loop): **a class on a snippet call never reaches the DOM; a 403 bounce and a widget-pinned session probe both read as sign-outs; app restarts matched a "signs me out" report by timing.** Detection-gaps row: `Class` on a `SNIPPETCALL` is green through check, exec, mxbuild, lint and DESCRIBE, and absent in the browser ([#336](https://github.com/MendixMau/mxcli-project-toolkit/issues/336)). Testing-shape §4 gains two false-red rows: `login.html?messageCode=403` with the session kept ([#338](https://github.com/MendixMau/mxcli-project-toolkit/issues/338)), and instruments pinned to one grid name or a typed menu list (1/7 and 7/34 false FAILs after a redesign, [#339](https://github.com/MendixMau/mxcli-project-toolkit/issues/339)). ui-loop: say so before a restart while a human uses the app ([#337](https://github.com/MendixMau/mxcli-project-toolkit/issues/337)) — three-app field run, 2026-10-14
2526
- log(bug-logs): **upstream draft for `mxcli run --local --watch`: a theme-only rebuild deletes `dist/pages` and still reports a successful reload** ([#284](https://github.com/MendixMau/mxcli-project-toolkit/issues/284)). `bug-logs/pending-github-issues/watch-theme-rebuild-drops-dist-pages.md`, status DRAFT — NOT FILED: the repro (one SCSS edit, every page 404s on `dist/pages/<Page>.js`, a restart restores all 135 bundles; twice in one app on mxcli v0.26.0 / Mendix 11.15.0), the other change classes watch serves stale, the timing table (reload 35 builds median 3.8 s, restart 44 builds median 19.2 s, max 55.2 s, 928 s total) and the upstream questions: why a restart is about 5× a reload, and whether a recreated microflow keeps its old compiled version by name. The toolkit side is already on master (exec.sh restart verdicts, `app-restart.sh`, ui-loop.md "What watch picks up"). Field evidence: the 2026-10-12 three-app UX run and its 2026-10-14 recurrence, as recorded in #284. — field retro #284, MendixMau
2627
- fix(close-task): **`close-task.sh` resolves `checkpoint.sh` instead of printing it bare.** The script ships at `claude-hooks/bin/checkpoint.sh` and reaches `~/.claude/bin` only via the opt-in `bin/install-claude-hooks.sh --basic`, so a project without the hooks got a `checkpoint.sh --write` step it could not run. `close-task.sh` now looks in PATH, then `~/.claude/bin`, then `$MXTK_ROOT/claude-hooks/bin`, and prints the full path it found, single-quoted so a path with spaces survives copy-paste. If none is found it prints `checkpoint.sh not installed — run <toolkit>/bin/install-claude-hooks.sh --basic, or skip: RESUME.md is the resume source` and carries on; the exit code still means only "writes owed". `close-the-loop.md` step 4 says the same. The `~/.claude/bin` copy (`claude-hooks/bin/close-task.sh`) now prints its sibling `checkpoint.sh` by full quoted path, because `~/.claude/bin` is usually not on PATH. Fixture `tests/wave2/test-close-task-checkpoint.sh` (14 cases, including a space and `'` in HOME and the toolkit path; 11 fail on master). Field evidence: the reporter's existing-app run, where the closing agent had to skip the step with no pointer. — joshuamoesa (#358)

‎agents/architect-agent.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ Run it at Stage 3 against the **drawn** diagram, and again at Stage 5 against th
108108

109109
| # | Check | Bound |
110110
|---|---|---|
111-
| 1 | Paths that end exactly once | N of N paths; 0 activities after a terminal |
112-
| 2 | Boundary events whose type is named **and** whose terminator matches that type | N of N boundary events |
113-
| 3 | Parallel splits with ≥2 paths and 0 *End workflow* / 0 *Jump to* at **any** depth in a branch | N of N splits |
114-
| 4 | Enum-branching activities carrying every value **plus Empty** | N of N decisions + call-microflows-returning-enum + AI agent tasks |
115-
| 5 | User tasks whose targeting mechanism is named, **with the sentence it came from quoted** | N of N user tasks — `ASSUMED: no targeting` is legal, blank is not |
116-
| 6 | User tasks with an error handler for empty targeting, or an expression that provably cannot be empty | N of N user tasks |
117-
| 7 | Multi-user tasks with decision method **and** completion timing stated, sourced to a business rule | N of N multi-user tasks |
118-
| 8 | Expressions referencing only `$WorkflowContext` / `$WorkflowInstance` | N of N expressions |
119-
| 9 | Event sub-processes with one start event, correct family, recurrence in bounds | N of N sub-processes |
111+
| 1 | Paths that end exactly once (§1) | N of N paths; 0 activities after a terminal |
112+
| 2 | Boundary events whose type is named **and** whose terminator matches that type (§2) | N of N boundary events |
113+
| 3 | Parallel splits with ≥2 paths and 0 *End workflow* / 0 *Jump to* at **any** depth in a branch (§4) | N of N splits |
114+
| 4 | Enum-branching activities carrying every value **plus Empty** (§5) | N of N decisions + call-microflows-returning-enum + AI agent tasks |
115+
| 5 | User tasks whose targeting mechanism is named, **with the sentence it came from quoted** (§6) | N of N user tasks — `ASSUMED: no targeting` is legal, blank is not |
116+
| 6 | User tasks with an error handler for empty targeting, or an expression that provably cannot be empty (§6) | N of N user tasks |
117+
| 7 | Multi-user tasks with decision method **and** completion timing stated, sourced to a business rule (§7) | N of N multi-user tasks |
118+
| 8 | Expressions referencing only `$WorkflowContext` / `$WorkflowInstance` (§8) | N of N expressions |
119+
| 9 | Event sub-processes with one start event, correct family, recurrence in bounds (§3) | N of N sub-processes |
120120
| 10 | Constructs checked against §11 and marked *proven* or *hand-add in Studio Pro* | N of N constructs; every hand-add is its own numbered build-plan row |
121121
| 11 | **If the source is a BPMN/swimlane diagram:** pools counted, lanes carried into row 5, every element screened against §13 | N pools = N workflows; N of N elements screened; every NOT-SUPPORTED one has a `fit-gap.md` row. *"Source is not a process diagram"* is legal |
122122

‎agents/test-agent.md‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,9 @@ write from a silently discarded one. Cross-check every state-changing result aga
113113
database (`learned-db-assertions.md`) rather than trusting the screen.
114114

115115
A trace rung (OpenTelemetry) is **optional and per-project** — include it only if this project
116-
opted in. If it did, {{OTEL_SETUP}} describes the setup, and two rules are absolute:
117-
118-
1. **Guard against an empty capture first.** `[].every(...)` is `true`, so trace assertions pass
119-
vacuously over zero spans. Assert the span set is non-empty *before* asserting anything about
120-
its contents. Also confirm the action wasn't a no-op — navigating to the page you are already
121-
on fires nothing.
122-
2. **A microflow's status is not its activities' status.** A microflow with an error handler
123-
reports `OK` while its own activity spans are `ERROR` — the handler swallowed a real failure.
124-
Always walk the activity spans. A page can render fine with an empty grid over a completely
125-
dead integration, and both a UI check and a microflow-status check will lie about it.
116+
opted in ({{OTEL_SETUP}} describes the setup). Its two absolute rules (non-empty span set first;
117+
walk activity spans, not microflow status; navigating to the page you are already on fires
118+
nothing) → see `testing-shape.md` §4, the **Trace** rows.
126119

127120
## The wiring sweep — you own it, and it leaves a file
128121

‎skills/design-artifacts.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ for the facts behind each check.
410410
**The property that makes this worth gating: a design-system defect is dormant until some widget
411411
carries the class.** So the defects are all present from the first build and surface one at a time,
412412
much later, as UI work attaches classes to pages. "The build is green and the pages look fine" is
413-
not evidence that the design system is correct — it is evidence that it is not being exercised yet.
413+
not evidence that the design system is correct — it is evidence that it is not being exercised yet,
414+
and it reads identically either way.
414415

415416
---
416417

@@ -450,7 +451,7 @@ mdlsource/gallery/
450451
## Anti-Patterns This Skill Prevents
451452

452453
- **Wireframes before a design system.** Produces inconsistent screens with no shared tokens; the Atlas theme becomes a per-page cleanup job.
453-
- **Embedding tokens in `design-system.html` instead of a separate `ds.css`.** Wireframes must redeclare tokens → drift and inconsistency between screens.
454+
- **Embedding tokens in `design-system.html` instead of a separate `ds.css`** → see `learned-stylegallery.md` § Anti-Patterns This Skill Prevents.
454455
- **Skipping `brand.md` and `target-ui.md`.** Design decisions end up undocumented; deliberate inversions (primary/CTA swap) look like mistakes to future maintainers.
455456
- **Hand-picking chart/KPI colors.** Bypasses the `dataviz` validator — ship colorblind-unsafe data. Use the validated palette.
456457
- **Generative design for screens that have a source screenshot.** Invents divergence you then correct back toward the source.

‎skills/existing-app-assurance.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ the browser, and only one of them is a specificity problem:
7777
grep -c '<a probe selector from your partial>' deployment/web/theme.compiled.css
7878
```
7979

80-
The app-level partial belongs in `theme/web/main.scss`, which compiles **last** — after Atlas Core
81-
and every module theme source — so it overrides Atlas with no `!important`.
80+
The app-level partial belongs in `theme/web/main.scss` → see `learned-stylegallery.md` § The Mendix DOM contract (why it overrides Atlas with no `!important`).
8281

8382
**3. Build or wire up the StyleGallery, even retroactively.** If the module exists, put it in a
8483
navigation profile and grant it to a role a demo user holds. If it does not, build one page with one

‎skills/full-harness-audit.md‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,8 @@ adding a fourth row to the table above.
8080

8181
## 3. The five journey rungs — what "the golden path is proven" actually requires
8282

83-
One journey = one persona walking a path with carried state, asserted in this order (each rung is
84-
only meaningful if the one above held):
85-
86-
| # | Rung | Catches |
87-
|---|---|---|
88-
| 1 | Landing guard | without it, every later assertion runs against the *previous* page |
89-
| 2 | What the screen says | the machine can do the work right and the screen can still lie about it |
90-
| 3 | Ordered spans | existence-only checks can't tell a skipped step from a reordered one |
91-
| 4 | Data effects (3 claims: delta / assocMustBeSet / mustPointAt) | saved vs. saved-with-link vs. saved-with-the-*right*-link |
92-
| 5 | Outcome | per-step deltas can each be right while the journey's net result is wrong |
93-
94-
Full spec, mutants, and the false-green register this exists to close: `journey-proof.md`,
95-
`testing-shape.md` §4.
83+
→ see `journey-proof.md` § The five rungs (one persona, carried state; each rung only meaningful if
84+
the one above held). The false-green register it closes: `testing-shape.md` §4.
9685

9786
## 4. The cadence layer — the thing most likely to be silently unmet
9887

‎skills/harness-architecture.md‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,8 @@ engine uniformly testable.
294294

295295
## 6. Rungs 6 and 7 are a separate instrument, not part of the journey
296296

297-
**The journey ships FIVE rungs and SEVEN mutants** (rungs 3 and 4 each carry two independent
298-
claims). `design-audit.js` produces artifacts labelled *rung 6* and *rung 7*; those labels refer to
299-
**that separate instrument**, not to a sixth and seventh rung of the journey.
300-
301-
Do **not** merge them into one 1-7 table. Do **not** cite rung 6 or 7 in a gate, a module brief or
302-
a report as though they were part of the shipped spec — `journey-proof.md` forbids exactly this,
303-
and the reason is the discipline the whole harness rests on: they pass their own positive control
304-
but have not yet gone red on real work a human then agreed was a real defect. Promoting an
305-
instrument on a green run is the move this harness exists to forbid.
297+
→ see `journey-proof.md` § "Rungs 6 and 7" (top of the file) — five rungs, seven mutants; `design-audit.js`'s
298+
*rung 6/7* labels name that separate instrument.
306299

307300
Run them, read them, report what they say. They are not verdicts.
308301

‎skills/journey-proof.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ run on real work and watched going red. That is the whole of the claim.
3333
>
3434
> So: **five rungs, seven mutants** (rung 3 and rung 4 each carry two). "Rung 6/7" in a
3535
> `design-audit` artifact refers to that separate instrument, not to a sixth and seventh rung of the
36-
> journey.
36+
> journey. Do **not** merge them into one 1–7 table.
3737
3838
---
3939

0 commit comments

Comments
 (0)