Skip to content

feat(portal): owners and admins see failing tier 2 patches - #718

Merged
allisonmahmood merged 2 commits into
mainfrom
portal/712-health
Oct 16, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
portal/712-health

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #717. It can ship once #713, #715, #716 and #717 are in; the rest of the stack is complete without it.

When an owner's tier 2 tool starts failing, they don't find out unless they open its log. An admin tidying the company can't see which tools are broken either.

Fix

  • InvocationLog.failures({ companyId, since }). Per patch, the number of top-level entries started since since whose effective outcome is one the log's Failed filter shows. It reuses the filter's own outcome expression, now named failed: commit proof reads as success, an overdue pending entry reads as unknown, and unknown isn't a failure. One grouped query over a new partial index, runtime_invocations_top_level_recent (company_id, started_at) WHERE parent_id IS NULL (migration 0018, after feat(patches): Patchy remembers what each person opens #713's 0017).
  • Who sees it. Only the tier 2 patches the viewer manages (the owner, or any patch for admins). A member who manages none never queries the log.
  • All patches. A Health column (OK, or N failed linking to the log filtered to Failed), and the Needs attention reason "N calls failed in the last day" with a See the log button. A deletion near reclamation and a deactivated owner still come first.
  • Home. An owner's own failing tools are named at the top, each with its count and a link to its failed entries. Admins see everyone's in All patches, not on Home.
  • patchy dev's stub InvocationLog answers failures with nothing, like its other reads.

Verified

  • InvocationLog.test.ts: two failed top-level entries of the last day count. An entry 25 hours old, an overdue pending one, a nested failure and a success don't. The Failed filter lists the same entries plus the older one.
  • PortalPages.test.ts, "patch health": three failures today and one two days ago show as 3 in the owner's Home warning, linked to log?outcome=failed, and not on a member's or an admin's Home. Owner and admin see Health (3 failed, OK) and the Needs attention reason. A member sees no Health column, no counts and no Needs attention tab.
  • pnpm check: format, lint, typecheck and synth pass. cliRepoBuild.test.ts timed out under local load, as on the PRs below, where CI passes it.

Release impact

  • Breaking
  • Not breaking: one read added to the log service and to the portal's pages, plus one additive index; no wire or CLI change.

Surfaces

  • Migrations. 0018_invocations_top_level_recent in Runtime's migrations. It takes the next id after feat(patches): Patchy remembers what each person opens #713's 0017; if another migration lands first, renumber it.
  • Vocabulary. Portal glossary: All patches (Health) and Home (the owner's warning). docs/product.md's portal paragraph.
  • Served pages. Composes note, pill and list; no new component.
  • Wire contract, CLI, migrations, dev loop and repo layout: not touched.

Part of #707. Closes #712.

Made 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 area:ui Portal and first-party browser pages, shared rendering and styles size:m 100-500 changed lines labels Oct 15, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review: GPT 6.1 Sol, xhigh, round 1. One finding, fixed in the latest commit.

  1. The failure count had no usable index. runtime_invocations_parent is partial (WHERE parent_id IS NOT NULL), and the patch index leads with patch_id, so the company-wide count walked every patch's history. Sol measured 492 index searches and 2,645 buffers at 200k rows. Migration 0018 adds runtime_invocations_top_level_recent (company_id, started_at) WHERE parent_id IS NULL, which Sol measured at one search and six buffers.

Sol found no correctness, authority or escaping issues otherwise. The migration record test passes with 0017 (#713) and 0018.

Base automatically changed from portal/711-card-tabs to main October 16, 2026 01:27
allisonmahmood and others added 2 commits October 16, 2026 03:27
InvocationLog.failures counts each patch's top-level entries of the
last day with the outcomes the log's Failed filter shows, in one grouped
query. For the tier 2 patches a viewer manages, All patches shows a
Health column and lists failures under Needs attention, and Home names
an owner's own failing tools, each linked to the failed log. A member
who manages no tier 2 patch never queries the log.

Part of #707. Closes #712.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The count assumed the parent index, which is partial on nested entries,
so it walked the patch index's history per patch. Migration 0018 adds
runtime_invocations_top_level_recent on (company_id, started_at) for
top-level entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit 49b47e4 into main Oct 16, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the portal/712-health branch October 16, 2026 01:37
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
Stacked on #718. It ships with the rest of the stack.

Tested on the real instance, Home and All patches read grey next to the
mockup. Patch marks used the papers' near-white tints (`--paper-blue`,
`--paper-green`, `--paper-amber`), so no mark ever stood out, and the
Pages panel and its group labels were flat.

## Fix

All of it is shell components, so every page that shows a patch picks it
up.

- **Mark tints.** New `--tint-green`, `--tint-blue`, `--tint-amber` and
`--tint-pink` tokens, the mockup's, stronger than the papers. `mono`
keeps highlighter yellow as one of five tints picked from the name.
- **Sizes.** A tile's mark is a size up (44px). The card's header uses
`mono-lg` or `page-mark-lg`, via `patchMark(name, tier, true)`.
- **New** is `tag-new`, a yellow tag, on Home and in All patches.
- **Pages panel.** `side-panel` sits on paper with the tiles' hard
shadow. Group labels use a new `shelf-label` (small, capitalised,
muted), replacing plain supporting text.
- `ui-consistency` documents the tints, sizes, `tag-new` and
`shelf-label`.

## Verified

- In the browser, `pnpm dev up brightline`: Home, All patches and a card
render the mockup's colours with no console errors.
- Portal, core and Company page tests pass (174). Markup only gains
classes.

## Release impact

- [ ] **Breaking**
- [x] **Not breaking**: CSS and class names on first-party pages only.

## Surfaces

- **Served pages.** Shell component styles only; page CSS is untouched
apart from removing Home's local group-label rule.
- Wire contract, CLI, migrations and docs beyond `ui-consistency`: not
touched.

Part of #707.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
…u when they fail (#720)

Release 13's What's new entry, written from `c9b8fc4`, ahead of
deploying it. `patchy` and `CURRENT_RELEASE` move to `0.13.0`, so CLIs
and patch repos installed before this deploy are told to upgrade.

| Change | PRs |
| --- | --- |
| New: Home puts the patches you use first | #713, #716, #719 |
| New: Every patch in one list | #715 |
| Improved: Each patch's page leads with Open | #717 |
| New: See when your tools are failing | #718 |
| Fixed: Everyone has a name | #687 |
| Improved: Your company's look is easier to get right | #697, #696,
#703, #688 |
| Improved: Forms follow your look's error states | #691, #692 |
| Improved: Clearer answers when a publish goes wrong | #686, #685, #689
|
| Fixed: Your agent's Patchy commands are steadier | #695, #704, #680,
#681 |
| Behind the scenes: stricter checks on static pages and tools' database
requests; malformed requests are logged | #682, #693, #683 |
| Behind the scenes: usage numbers count every publish, sharing change
and restore | #698, #699, #700, #690 |
| Test and tooling only, no line | #705, #702, #701, #694, #684, #607 |

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

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

Labels

area:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(portal): owners and admins see failing tier 2 patches

1 participant