Skip to content

chore: seed the lode and enable the pre-PR gate - #31

Open
mhenrixon wants to merge 2 commits into
mainfrom
chore/lode
Open

mhenrixon wants to merge 2 commits into
mainfrom
chore/lode

Conversation

@mhenrixon

@mhenrixon mhenrixon commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

This repository joins the shared lode plugin from zoolutions/claude-plugins: durable memory in lode/, a pre-PR gate that reviews every branch against the repo's own rules and learnings before anything can be pushed, and the shared workflows (/lode:lfg, /lode:review-pr, /lode:finish-prs, /lode:debug-flaky, /lode:tdd, /lode:plan) reading lode/workflow.md.

  • lode/ — summary, terminology, practices, map, and eight subsystem summaries (form API, inference, theming, client validation, live validation, packaging, testing, docs site). Every claim cites a file and method; every count was computed (17 Plain twins of which 14 override view_template, 19 theme roles, 18 spec files with 202 examples, 16 docs pages).
  • lode/review/ — two rules: the tailwind.sources.css globs rule (cubic bc7ba61f merged with the PR fix(docs): repoint deploy at zoolutions org and bump docs-kit to 1.0.8 #24 thread) and the one-subsection-per-changelog-category rule from PR fix(file_input): append [] to the name for multiple-file inputs #23, which the current CHANGELOG still violates and the entry says so.
  • lode/workflow.md (187 lines) — the profile.
  • Retired: lfg, tdd, plan, github-review-pr, github-review-failures, github-review-comments, finish-prs. Kept: architect, review-pr, security. New .claude/settings.json enabling lode@zoolutions; the Memory section in both CLAUDE.md and AGENTS.md; .claude/README.md and SKILL_TEMPLATE.md updated; .gitignore gains lode/tmp/.

No Ruby changes. Reading the code for the lode surfaced one defect, filed as #30: bundle exec rake, the documented pre-commit gate, always exits 1 because RuboCop::RakeTask walks into docs/ and cannot load docs_kit/rubocop; CI's bundle exec rubocop lib spec is clean. Nine over-general claims in the first drafts were corrected against the code (which model touches are respond_to?-guarded, which builders bypass apply_validations, that live_deny subtracts last). Ten smaller doc-versus-code gaps are recorded in the lode where they apply.

Test plan

Deviations & judgment calls

  • Seeded from a fresh clone by an agent following the plugin's /lode:seed, resumed once after a rate limit (every draft re-verified), then gated here.
  • CLAUDE.md and .claude/rules/git-workflow.md still name bundle exec rake as the gate; the lode states that it fails and links bundle exec rake always fails: RuboCop::RakeTask walks into docs/ and cannot load docs_kit/rubocop #30 rather than rewriting the rule in a seeding PR.
  • Pushed with LODE_SKIP_GATE=1 after the gate passed: the orchestrating session runs the cached 0.1.0 push hook keyed on a different checkout. A session opened here will not need it.

Gate

Rounds: 1. Findings: 1 P2 fixed (the example count), 2 P3 (one fixed, one disclosed). Rejected 0, deferred 0.

https://claude.ai/code/session_01Hga3idYBp7fWdj7GmmfofF


Summary by cubic

Seeds the repository's lode (durable project memory) and enables the shared lode@zoolutions plugin's pre-PR gate, which reviews every branch against the repo's own rules before push. No Ruby changes.

New Features

  • Adds lode/ with a summary, terminology, practices, map, and eight subsystem summaries (form API, inference, theming, client validation, live validation, packaging, testing, docs site); every claim cites a file and method.
  • Adds lode/review/ with two accepted rules: the tailwind.sources.css globs rule and the one-subsection-per-changelog-category rule.
  • Adds lode/workflow.md (187 lines), enables the lode@zoolutions plugin in .claude/settings.json, and points CLAUDE.md and AGENTS.md at the memory.

Migration

Written for commit 06dae0e. Summary will update on new commits.

Review in cubic

A fork of the code's own facts, so the next session does not have to re-derive
them and the gate has something to enforce.

lode/ now holds the baseline (summary, terminology, practices, lode-map, the
plans pointer) and one folder per subsystem: form-api, inference, theming,
client-validation, live-validation, packaging, testing and docs-site. Every
claim was checked against the code, and every line range and count was computed
with a script rather than read off the screen — the leaf/role/example counts,
the def-to-end ranges, the 198 examples, the 19 (+2 reactive) theme roles.

lode/workflow.md is the profile the shared /lode: workflow commands read. Its
ten headings are filled from the code and config as they are, from CLAUDE.md
and .claude/rules, and from the seven local commands this change retires —
their conflict rules, CI runbook and constraint tables move there rather than
being lost with the files.

Two review rules, in lode/review/. From cubic (1 learning) and from the merged
PR review threads (2 accepted findings across 22 merged PRs): three raw
findings, merged to two, none dropped — the cubic learning and PR #24 are the
same rule about docs/app/assets/stylesheets/tailwind.sources.css, so they share
one entry. PR #23's "one ### subsection per release heading" is the other.
Neither has a test; both say so.

Retired the seven local commands the plugin supersedes: lfg, tdd, plan,
github-review-pr, github-review-failures, github-review-comments, finish-prs.
architect, security and review-pr are repo-specific and stay. CLAUDE.md's
command table, its model-tier list, .claude/README.md and SKILL_TEMPLATE.md now
name what actually exists.

The plugin is enabled in .claude/settings.json, lode/tmp/ is gitignored, and
CLAUDE.md and AGENTS.md both carry a Memory section pointing at lode-map.md.

Ten doc-versus-code disagreements were found and deliberately not fixed here —
a seeding change describes the tree it ships in. The sharpest: `bundle exec
rake` is named as the pre-commit gate in two places and always fails, because
RuboCop::RakeTask passes no paths and walks into docs/, which needs a gem from
a different bundle.

Claude-Session: https://claude.ai/code/session_01Hga3idYBp7fWdj7GmmfofF
rspec --dry-run reports 202 examples; the grep-based count of 198 missed
the five examples one each loop builds in components_spec.rb, so that
file's row and the three suite totals are corrected. The retired
github-review-pr command's note that docs/config/routes.rb never
conflicts per page is restored to the Conflicts table.

Claude-Session: https://claude.ai/code/session_01Hga3idYBp7fWdj7GmmfofF

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 29 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="lode/review/docs-site.md">

<violation number="1" location="lode/review/docs-site.md:3">
P2: The heading's stated requirement contradicts the file this finding endorses. It says globs 'must be paths that exist outside the machine that generated them', yet 'Proven by' blesses a committed file whose three @source globs all point at /Users/mhenrixon/... paths that exist only on the generating machine — on any other checkout or in CI they match nothing, the very 'silently drops those classes' failure the rule describes. The body sections state the real intent (real gem dir + real checkout, never ephemeral/sandbox paths); reword the heading to match so the gate and future reviewers aren't misled.</violation>
</file>

<file name="lode/terminology.md">

<violation number="1" location="lode/terminology.md:33">
P3: The field-variants entry lists `form_options` in the stack of modifiers prepended to every `field`'s inner input, but `default_field_variants` (`PhlexForms.config.field_variants + @field_variants`, form.rb:155) is the only mechanism that prepends to field inputs, and it never includes `form_options` modifiers — `Base.form_options` passes its modifiers to the Form component's own render (base.rb:81), i.e. the form element. Remove `form_options` from the field-variant stack (or reword to say it styles the form element, not field inputs) so the lode doesn't mislead readers into using `form_options` expecting it to variant every field.</violation>
</file>

<file name="CLAUDE.md">

<violation number="1" location="CLAUDE.md:115">
P3: "these three" is ambiguous: the preceding bullets list four tiers (haiku, sonnet, opus, fable), so a reader cannot tell whether it means three of the tiers or the three local commands. Say which three, e.g. the three pinned tiers (haiku, sonnet, opus) or the three local commands.</violation>
</file>

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Fix all with cubic | Re-trigger cubic

Comment thread lode/review/docs-site.md
@@ -0,0 +1,8 @@
Accepted review findings about the docs app under `docs/` and its generated assets.

### `tailwind.sources.css` is committed output whose `@source` globs must be paths that exist outside the machine that generated them

@cubic-dev-ai cubic-dev-ai Bot Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The heading's stated requirement contradicts the file this finding endorses. It says globs 'must be paths that exist outside the machine that generated them', yet 'Proven by' blesses a committed file whose three @source globs all point at /Users/mhenrixon/... paths that exist only on the generating machine — on any other checkout or in CI they match nothing, the very 'silently drops those classes' failure the rule describes. The body sections state the real intent (real gem dir + real checkout, never ephemeral/sandbox paths); reword the heading to match so the gate and future reviewers aren't misled.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lode/review/docs-site.md, line 3:

<comment>The heading's stated requirement contradicts the file this finding endorses. It says globs 'must be paths that exist outside the machine that generated them', yet 'Proven by' blesses a committed file whose three @source globs all point at /Users/mhenrixon/... paths that exist only on the generating machine — on any other checkout or in CI they match nothing, the very 'silently drops those classes' failure the rule describes. The body sections state the real intent (real gem dir + real checkout, never ephemeral/sandbox paths); reword the heading to match so the gate and future reviewers aren't misled.</comment>

<file context>
@@ -0,0 +1,8 @@
+Accepted review findings about the docs app under `docs/` and its generated assets.
+
+### `tailwind.sources.css` is committed output whose `@source` globs must be paths that exist outside the machine that generated them
+- **Holds because:** `bin/build-css` writes one `@source "<path>/**/*.rb";` line per gem from `bundle show daisyui|docs-kit|phlex-forms`, so the file records whatever the generating environment resolved — a real gem dir and the repo checkout normally, but an ephemeral worktree or sandbox path when the build ran in one. `application.tailwind.css` `@import`s the generated file, and `phlex-forms` is in the list because the docs render live gem components whose literal class strings (`badge`, `menu`, `input`) Tailwind must scan. Every build path does regenerate it first — `bun run build:css` directly, and Docker through `lib/tasks/build_css.rake`, which enhances `assets:precompile` — so a stale path is not a build failure. It is a landmine: a Tailwind run that consumes the committed file without regenerating silently drops those classes and ships an unstyled site, the exact failure `bin/build-css`'s fail-fast guard exists to prevent, and nothing in CI checks it.
+- **Where:** `docs/bin/build-css`, `docs/app/assets/stylesheets/tailwind.sources.css`, `docs/app/assets/stylesheets/application.tailwind.css`, `docs/lib/tasks/build_css.rake`, `docs/Dockerfile` (`bin/rails assets:precompile`)
</file context>
Suggested change
### `tailwind.sources.css` is committed output whose `@source` globs must be paths that exist outside the machine that generated them
### `tailwind.sources.css` is committed output whose `@source` globs must point at real bundle-resolved gem dirs and the real repo checkout — never ephemeral worktree or sandbox paths
Fix with cubic

Comment thread lode/terminology.md
Comment on lines +33 to +35
- **field variants** — modifiers prepended to every `field`'s inner input;
stacked global (`PhlexForms.config.field_variants`) → form
(`field_variants:` / `form_options`) → call site, last wins.

@cubic-dev-ai cubic-dev-ai Bot Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The field-variants entry lists form_options in the stack of modifiers prepended to every field's inner input, but default_field_variants (PhlexForms.config.field_variants + @field_variants, form.rb:155) is the only mechanism that prepends to field inputs, and it never includes form_options modifiers — Base.form_options passes its modifiers to the Form component's own render (base.rb:81), i.e. the form element. Remove form_options from the field-variant stack (or reword to say it styles the form element, not field inputs) so the lode doesn't mislead readers into using form_options expecting it to variant every field.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lode/terminology.md, line 33:

<comment>The field-variants entry lists `form_options` in the stack of modifiers prepended to every `field`'s inner input, but `default_field_variants` (`PhlexForms.config.field_variants + @field_variants`, form.rb:155) is the only mechanism that prepends to field inputs, and it never includes `form_options` modifiers — `Base.form_options` passes its modifiers to the Form component's own render (base.rb:81), i.e. the form element. Remove `form_options` from the field-variant stack (or reword to say it styles the form element, not field inputs) so the lode doesn't mislead readers into using `form_options` expecting it to variant every field.</comment>

<file context>
@@ -0,0 +1,58 @@
+- **modifier** — a positional Symbol on a component call (`:primary`, `:lg`).
+  Most name a daisyUI variant; the 16 in `Builder::INPUT_TYPE_MODIFIERS` name an
+  input type instead and are stripped before the leaf sees them.
+- **field variants** — modifiers prepended to every `field`'s inner input;
+  stacked global (`PhlexForms.config.field_variants`) → form
+  (`field_variants:` / `form_options`) → call site, last wins.
</file context>
Suggested change
- **field variants** — modifiers prepended to every `field`'s inner input;
stacked global (`PhlexForms.config.field_variants`) → form
(`field_variants:` / `form_options`) → call site, last wins.
- **field variants** — modifiers prepended to every `field`'s inner input;
stacked global (`PhlexForms.config.field_variants`) → form
(`field_variants:`) → call site, last wins.
Fix with cubic

Comment thread CLAUDE.md
- `opus` — orchestration, security, PR review (`/architect`, `/security`, `/review-pr`)
- `fable` — read-only planning that hands execution to cheaper models; choose it per-session with `/model` for architecture and the hardest debugging

The `/lode:` commands pin their own tiers in the plugin; these three apply to the

@cubic-dev-ai cubic-dev-ai Bot Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: "these three" is ambiguous: the preceding bullets list four tiers (haiku, sonnet, opus, fable), so a reader cannot tell whether it means three of the tiers or the three local commands. Say which three, e.g. the three pinned tiers (haiku, sonnet, opus) or the three local commands.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At CLAUDE.md, line 115:

<comment>"these three" is ambiguous: the preceding bullets list four tiers (haiku, sonnet, opus, fable), so a reader cannot tell whether it means three of the tiers or the three local commands. Say which three, e.g. the three pinned tiers (haiku, sonnet, opus) or the three local commands.</comment>

<file context>
@@ -93,9 +108,12 @@ Commands and agents pin a model **tier** via frontmatter aliases, not a full
+- `opus` — orchestration, security, PR review (`/architect`, `/security`, `/review-pr`)
+- `fable` — read-only planning that hands execution to cheaper models; choose it per-session with `/model` for architecture and the hardest debugging
+
+The `/lode:` commands pin their own tiers in the plugin; these three apply to the
+local commands under `.claude/commands/`.
 
</file context>
Fix with cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant