Skip to content

feat(companies): a look restore records who restored it and why #587

Closed

Description

@allisonmahmood

Restoring moves the pointer and records nothing, so the notice after a restore reads rev 8 → 7 by Sam: first green, crediting the revision's original author and note. #568 kept the ticket's shape on purpose. If a restorer and a note should show (rev 8 → 7, restored by Ada), the restore needs its own record and the notice and patchy look history need to read it.

Found while building the company look (#547). Filed by Claude Fable 5.1 (orchestrator) in Claude Code, running in T3 Code, for Allison.

Activity

  1. added
    needs-triage
    area:server
    area:cli
    on Oct 7, 2026
  2. allisonmahmood commented on Oct 10, 2026

    @allisonmahmood
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: enhancement
    Summary: A look restore records who made it, when and an optional reason, and the change notice and patchy look name that person instead of crediting the revision's publisher.

    Current behavior:
    Restoring a look (patchy look restore <n|none>, POST /api/look/restore) moves the company's current-revision pointer and records no actor, time or reason. Generation stamps the current revision's own author, time and note into a repo's generated index.json under look. So when a repo at revision 8 refreshes after Ada restores 7, the notice reads Acme's look changed, rev 8 → 7 by Sam: first green, crediting Sam with Ada's decision. patchy look shows revision 7's original byline and nothing about the restore. Only the look.restored analytics event knows who restored, and nobody using Patchy sees it.

    Desired behavior:

    • A company keeps one record of its latest restore: who, when and an optional note. This mirrors a patch rollback's last-change record on the patch. It is not a history: a later restore overwrites it. That is a decision, not an omission.
    • A restore that moves the pointer, including to none, sets the record in the same transaction. Restoring the revision that is already current changes nothing (the analytics event already skips this case). A publish clears the record, because the new revision's own author, time and note describe the current look.
    • LookRestoreRequest accepts an optional note, validated as a LookNote. patchy look restore takes an optional --note "<why>". The note stays optional everywhere so existing CLIs keep working. The skills tell agents to pass the reason the person gave.
    • CompanyLook and LookRestored carry a top-level restored: { by: { id, name }, at, note } | null. It is top-level because current is null after restore none. The look read takes it from the same statement as the revisions. New decoders accept the key being absent, so a new CLI still works against an older server.
    • Generation writes the record into index.json beside look, from that same read. Notices still compare looks by revision and creation time only. So a restore that leaves a repo on files it already has stays silent, and an index.json without the key reads as today.
    • When the incoming index.json carries a restore record, the notice names the restorer and their note instead of the revision's author, whichever way the number moves. Example: Acme's look changed, rev 8 → 7, restored by Ada: rev 8 failed dark mode. Without a note: …, restored by Ada. For none, the notice names the restorer, then gives the existing Patchy-look explanation. Notices for forward publishes are unchanged.
    • patchy look and look restore show the restore under the current revision's byline, e.g. Restored by Ada on 2026-10-07: rev 8 failed dark mode., and also after restore none. --json carries restored. The History: list remains a list of publications.
    • The patchy-look project skill's description of the current look mentions the restore when there is one.

    Key interfaces:

    • Looks:
      • restore takes the restoring user's id and an optional note.
      • read returns the restore record next to current and revisions.
      • publish clears the record.
    • Wire:
      • LookRestoreRequest.note is optional.
      • CompanyLook.restored and LookRestored.restored are nullable and may be absent.
      • Regenerate docs/API.md.
    • Generated index.json: one new key beside look, null after a publish. Name it in the glossary's words.
    • A Companies migration for the record, with its id allocated in landing order.

    Acceptance criteria:

    • Sam publishes 7 and 8, then Ada restores 7 with a note. A repo at 8 refreshes and hears rev 8 → 7, restored by Ada: <note>, in text and in --json warnings.
    • Sam then publishes 9. patchy look shows no restore line, and a repo at 7 hears rev 7 → 9 by Sam: … as today.
    • Restoring the revision that is already current leaves the record and the analytics event unchanged.
    • restore none records the restorer, and the rev N → none notice names them.
    • A restore without --note is accepted and reads restored by Ada.
    • An index.json or look read without the new key produces today's output. A CLI from before the change decodes the new index.json and look read without errors.
    • A member's restore is still refused and records nothing.
    • ADR-0004, the CLI README, docs/product.md, the Companies glossary's "Look revision" entry, the global patchy skill (and its skills-lock.json hash) and the patchy-look / patchy-loop project skills match wherever they quote the notice or describe restore.

    Out of scope:

  3. added
    enhancement
    ready-for-agent
    and removed
    needs-triage
    on Oct 10, 2026
  4. added a commit that references this issue on Oct 15, 2026
    94b36b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:serverenhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions