Skip to content

feat(companies): a company look with revisions, and patchy look, look publish and look restore #565

Closed

Description

@allisonmahmood

Part of #547 (What a look is, Where it lives, Keeping it from churning, Checks at look publish).

What to build

A company owns its look. An admin's agent publishes a look folder (look.css, LOOK.md, a logo and any fonts the company may self-host) as the company's next revision, and every member's agent can read the current one.

  • Revisions. A company has an ordered list of look revisions and a pointer to the current one, like a patch's versions and its served version. Each revision records its author, time and a note. Having no look is a valid state and the starting one.
  • patchy look shows the current revision (number, author, time, note) and its files to any active member or their machine token, and lists the history. Under --json it returns the files' content so an agent can write or inline them.
  • patchy look publish <dir> --note "..." (admins) runs the checks, stores the next revision and makes it current.
  • patchy look restore <revision> (admins) makes an older revision current, and restore none returns the company to no look. Restoring moves the pointer; it does not copy the revision.
  • Members are refused with the names of the company's admins, so their agent can say who to ask.

Publish refuses, naming what failed:

  • a token that is missing or declared twice, out of the 15 in companies: a company look, so new patches look like their company by default #547; a colour that isn't an opaque #RRGGBB; or any !important, which would beat a patch's own CSS,
  • contrast below 4.5:1 for any text colour (fg, muted, link, success, warning, danger) on bg or on surface, or for accent-fg on accent,
  • any external reference: a look is self-contained, so no remote URL, protocol-relative URL or remote @import,
  • a folder over 512 KiB of published bytes, embedded fonts included, or a LOOK.md over 32 KiB. Both are starting values in the limits registry.

Acceptance criteria

  • An admin publishes revision 1, then 2. patchy look shows 2 with its author and note, restoring 1 makes 1 current, and restore none leaves the company with no look.
  • A member reads the current look and its history. Their publish and restore are refused by the instance, and the refusal names the admins.
  • Each check refuses a look that fails it and accepts the same look once fixed.
  • A look is readable only inside its own company.
  • Publishing and restoring a look are business events.

Surfaces

The Companies glossary (Look, Look revision) and the Companies section of docs/product.md; the wire contract and docs/API.md; ADR-0004 and the CLI README for the three commands, their --json shapes and exit codes; the limits registry for the size cap.

From the prototype (#563)

  • Real looks to test against. prototypes/company-look/looks/ on PR prototype(look): a dozen tokens and a brief make a tool read as its company #572 holds four looks: Linear, Duolingo, Vanguard and the Patchy look.
    • Under these checks, three values need a small fix first: Duolingo's danger on bg (4.30) and muted on surface (4.24), and Vanguard's muted on surface (4.21).
    • Fixed copies make good fixtures. Brand fonts and real logos stay out of the repo.
  • Prior art. scripts/check.mjs on that branch is a rough version of these checks in plain Node, with no browser.
  • Validate the effective token values, not only their presence: conflicting declarations, transparent colours and !important all undermine the override promise.
  • Sizes seen. look.css was 3 to 5 KB before fonts, LOOK.md 10 to 12 KB, the logo under 1 KB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:serverready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions