You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(companies): a look restore records who restored it and why #587
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.
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 --jsonwarnings.
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.
Activity
allisonmahmood commentedon Oct 10, 2026
Agent Brief
Category: enhancement
Summary: A look restore records who made it, when and an optional reason, and the change notice and
patchy lookname 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 generatedindex.jsonunderlook. So when a repo at revision 8 refreshes after Ada restores 7, the notice readsAcme's look changed, rev 8 → 7 by Sam: first green, crediting Sam with Ada's decision.patchy lookshows revision 7's original byline and nothing about the restore. Only thelook.restoredanalytics event knows who restored, and nobody using Patchy sees it.Desired behavior:
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.LookRestoreRequestaccepts an optionalnote, validated as aLookNote.patchy look restoretakes 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.CompanyLookandLookRestoredcarry a top-levelrestored: { by: { id, name }, at, note } | null. It is top-level becausecurrentis null afterrestore 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.index.jsonbesidelook, 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 anindex.jsonwithout the key reads as today.index.jsoncarries 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.Fornone, the notice names the restorer, then gives the existing Patchy-look explanation. Notices for forward publishes are unchanged.patchy lookandlook restoreshow the restore under the current revision's byline, e.g.Restored by Ada on 2026-10-07: rev 8 failed dark mode., and also afterrestore none.--jsoncarriesrestored. TheHistory:list remains a list of publications.patchy-lookproject skill's description of the current look mentions the restore when there is one.Key interfaces:
Looks:restoretakes the restoring user's id and an optional note.readreturns the restore record next tocurrentandrevisions.publishclears the record.LookRestoreRequest.noteis optional.CompanyLook.restoredandLookRestored.restoredare nullable and may be absent.docs/API.md.index.json: one new key besidelook, null after a publish. Name it in the glossary's words.Acceptance criteria:
rev 8 → 7, restored by Ada: <note>, in text and in--jsonwarnings.patchy lookshows no restore line, and a repo at 7 hearsrev 7 → 9 by Sam: …as today.restore nonerecords the restorer, and therev N → nonenotice names them.--noteis accepted and readsrestored by Ada.index.jsonor look read without the new key produces today's output. A CLI from before the change decodes the newindex.jsonand look read without errors.docs/product.md, the Companies glossary's "Look revision" entry, the globalpatchyskill (and itsskills-lock.jsonhash) and thepatchy-look/patchy-loopproject skills match wherever they quote the notice or describe restore.Out of scope:
look.restoredstays as it is.fix(companies): a person without a name is named by their email (#687)
feat(companies): a look restore says who restored it and why (#688)