Skip to content

feat(patchy): repos hear when the company look changes, and publish warns when behind - #581

Merged
allisonmahmood merged 5 commits into
mainfrom
look/568-look-notices
Oct 7, 2026
Merged

allisonmahmood merged 5 commits into
mainfrom
look/568-look-notices

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Since #567, dev start and refresh quietly swap a repo's look files to the company's current revision. Nobody hears that the tool's colours just changed, and publish ships whatever revision the repo happens to have.

Now the CLI says so, but only to pages that use the look:

  • A notice. When dev start or refresh (including add and remove) brings in a different revision from the one in the repo's index.json, the CLI prints Acme Co's look changed, rev 1 → 2 by Ada Park: darker green. Colours and fonts follow; to restyle this tool's components, ask your agent to update it to the current look. Under --json it goes in warnings. A restore reads rev 2 → 1, a first look none → rev 1, and a return to no look rev 1 → none, so the Patchy look stands in. If the new look has no logo and the page names patchy/_generated/logo.svg, the notice adds one sentence: the reference must go, because the next build fails on it. A dev start that fails on that build still prints the notice first, and in the failure document's warnings. The notice is remembered only once the new files are activated, so a rolled-back refresh announces nothing.
  • Publish warns, never pulls. For a page that uses the look, publish reads the company's current look (GET /api/look) before building. When the repo's revision differs, it ships the repo's own revision unchanged, exits 0 and warns: This repo has Acme Co's look rev 3, but the current look is rev 4 by Ada Park: darker green again. This version keeps the repo's look; run patchy refresh to bring it up to date.
  • Advisory only. If that look read fails, publish warns Could not check whether this repo's look is current: … and goes ahead. If refresh can't read /api/me, the notice says "The company's look changed".
  • Only for pages that use the look. A page uses the look when a non-comment line of its source names patchy/_generated/look.css or logo.svg. Every .html, .css and script file counts, outside node_modules/, dist/, dot folders and patchy/_generated/. That covers the tier 1 and 2 import, the tier 0 <link>, and a root stylesheet that @imports the look; tier 0 hears notices too. A commented-out import doesn't count. An alias, or a file nothing imports, is outside the rule. A page that names neither file hears nothing, and its publish sends no look request.

This is a text check, not the build's import walk the ticket mentions. The walk is a Vite plugin and only runs inside a build. Dev start and refresh decide what to say before any build runs, and when a look drops its logo, the build fails. That is the case where the notice matters most. One check serves all three commands. Revisions compare by number and creation time, since numbers restart per company.

ADR-0004, the CLI README, the patchy-loop skill and docs/product.md describe the notice and the warning.

Closes #568

Built by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:server Touches the server area area:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines labels Oct 7, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review round 1 (stack orchestration for #547): one Claude Opus 5.5 reviewer and three GPT-6.1 Sol reviewers (notice correctness, YAGNI + contract + tests, and an end-to-end read of every notice and warning through the bundled CLI against a dev instance), read-only against fe6f727.

Agreed sound: every transition's wording (none → 1, 7 → 8, 8 → 7, 1 → none, the dropped-logo sentence) is exact and grammatical in text and --json; the notice survives into the failure document when dev's build fails after a dropped logo; publish while behind warns, ships the repo's own bytes and exits 0; pages without references stay silent; the before/after comparison is ordered correctly against activation; docs updated (ADR-0004, README, patchy-loop, product.md). Tier 0 notices are a welcome departure from the ticket, since #567's starter links the generated CSS. The builder's four decisions stand, with the scan tightened below.

Sent to the builder:

  • The "uses the look" scan misses a root-level stylesheet that imports the look (a stale revision then ships silently) and fires on a commented-out import or an unreachable file: scan every page-source file in the repo outside the generated and dependency folders, skip comment-leading lines, and document the definition.
  • Remember the publish warning when it is discovered, hoist the look read out of the attempt's constructor and run it before the build.
  • Advisory lookups must not fail the command: a failed look read at publish becomes a warning; a failed me() at refresh drops the company name from the notice.
  • Remember the change notice only after activation succeeds, so a rolled-back refresh doesn't announce a revision that didn't land.
  • Compare createdAt with the revision number; docs mention add/remove; the look read runs on every publish of a page that uses the look (the PR body says otherwise); trim duplicated test matrix and helper.
  • Builder's call: a files-less read so publish doesn't download up to 512 KiB to compare one number.

Posted by Claude Fable 5.1 (orchestrator) in Claude Code, running in T3 Code.

@github-actions github-actions Bot added the area:ci CI, shared testing infrastructure, development scripts and tooling label Oct 7, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review round 2: the orchestrator read the fix commits (94d41e7, 58f360a) and the builder's dispositions. The "uses the look" scan now reads every page-source file in the repo outside dependency, build, dot and generated folders and skips comment-leading lines, with the definition stated in the README and the patchy-loop skill; the publish warning is computed before the build and kept for the failure document; a failed look read at publish or a failed me() at refresh degrade to a warning instead of failing the command; the change notice is kept for failure output only after the new files are activated; revisions compare by number and time; docs cover add/remove and the per-publish look read. The files-less look read was skipped on purpose: the clean version is a new public route that #547's later per-version look stamp would make dead, for a saving of at most 512 KiB on a command that already uploads a bundle. CI is green on 58f360a.

Verdict from the orchestrator: ready to merge after #579.

Posted by Claude Fable 5.1 (orchestrator) in Claude Code, running in T3 Code.

@allisonmahmood
allisonmahmood force-pushed the look/567-look-generation branch from 49a2856 to df2429c Compare October 7, 2026 15:03
Base automatically changed from look/567-look-generation to main October 7, 2026 15:16
allisonmahmood and others added 5 commits October 7, 2026 17:17
When generation brings in a different look revision from the one the repo's
index.json had, and the page's source names the generated look.css or logo,
the CLI prints "Acme's look changed, rev 7 → 8 by Sam: darker green. Colours
and fonts follow; to restyle this tool's components, ask your agent to update
it to the current look." and puts it in --json warnings. Restores, a first look
and a return to no look read the same way; a page whose new look dropped its
logo is told the reference must go.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Publish never pulls a look revision. For a page that uses the look, it reads
the company's current revision once, and when the repo's differs it publishes
the repo's own revision unchanged, exits 0 and warns, naming patchy refresh.
A page that doesn't use the look sends no look request.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…mand

The scan now covers every HTML, CSS and script file outside dependencies,
builds, dot folders and generated files, so a root stylesheet that imports the
look counts, and it skips comment lines, so a commented-out import doesn't.
Revisions compare by number and time, since numbers restart per company.

The checks are advisory: a failed look read at publish becomes a warning and
the publish goes ahead, before the build; a refresh without /api/me names "The
company". Notices are remembered only once activation succeeds, so a rolled
back refresh announces nothing, and publish remembers its warning when found.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@allisonmahmood
allisonmahmood merged commit 470780c into main Oct 7, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the look/568-look-notices branch October 7, 2026 15:26
allisonmahmood added a commit that referenced this pull request Oct 7, 2026
Release 8 of What's new, written for the deploy of the company look
stack (#547, first build). It covers everything merged after release 7's
`through`.

- **New: Your tools can look like your company** — #577, #579
- **New: Preview a look before you publish it** — #578
- **New: Setting up Patchy sets up your look** — #598 (the rebased
replacement for #582)
- **Improved: Patches hear when the look changes** — #581
- **Improved: Static pages can use embedded fonts** — #576
- Behind the scenes: the personal style file retires (#598)

Written by Claude Fable 5.1 in Claude Code, running in T3 Code.

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(patchy): repos hear about look changes, and publish warns when behind

1 participant