Skip to content

fix(cli): the TUI writes the applicable updates; CLI, server and report facts decided once - #229

Merged
sweepies merged 3 commits into
mainfrom
refactor/cli-server-leftovers
Nov 9, 2026
Merged

sweepies merged 3 commits into
mainfrom
refactor/cli-server-leftovers

Conversation

@sweepies

@sweepies sweepies commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Lookup, report, CLI and server leftovers from the post-refactor sweep.

Behaviour changes

  • TUI writes what it can. When some selected updates cannot be written in place, the TUI writes the rest and reports each skip with its reason, as patchula apply already did. It used to refuse the whole batch. Both share plan::outcomes. The TUI guide page is updated.
  • copier's git runs through patchula_process with GIT_TIMEOUT, so a hung git no longer stalls apply or the TUI.

One place for each fact

  • Window { cron, zone } lives in patchula_words. config and report re-export it, and the two converters are gone. Report JSON is unchanged.
  • report Location is still the wire DTO, now built through one From impl in manager (manager gains a patchula-report dependency; report depends only on words).
  • The OSV advisory URL is formatted by lookup::advisories::osv_url.
  • The CLI's --type choices come from Update::RANKED (an UpdateType newtype in cli), and the TUI filter wraps Option<Update> and cycles in rank order. Update::rank() is derived from RANKED. Declaration order (Ord) is unchanged, so sorted output and report JSON stay the same. Help output is byte-identical.
  • One kind→colour mapping feeds both the SGR and the ratatui painters.
  • "Current declaration" for display is one helper. Advisories keep the resolved version first, on purpose, with a comment saying why.
  • remote_flags() derives from REMOTE_POLICY. PATCHULA_RECHECK is parsed once.
  • The batch report filename grammar is one module, used by both the writer and the pruner.

Server

  • withheld() fails closed by construction: credentialed metadata is rebuilt by exhaustive destructuring, so a new metadata field does not compile until it is classified as kept or withheld. A new test covers it.
  • The webhook, public and installations code reads GitHub payloads through small serde structs instead of string-indexing Values.

Tests and comments

  • The schema tests assert known Pkl properties. A receipts test no longer pins an unrelated request count.
  • Stale and restating comments removed.

Left alone on purpose: evaluate_with's per-manager branches, the settings 1 Hz poll, apply's rejected flags. The lookup functions stay pub because the lookup integration tests call them.

View guided diff Turn on auto-fix

sweepies and others added 2 commits November 9, 2026 21:13
- Window { cron, zone } lives in patchula_words; config and report
  re-export it and the field-by-field converters are gone.
- report::Location builds from manager::Location through one From impl.
- OSV advisory URLs come from one helper; images reuse it.
- --type choices, the TUI filter and Update::ALL share one vocabulary;
  kind colours and the current-declaration display are shared too.
- PATCHULA_RECHECK parses once; remote flags derive from REMOTE_POLICY.
- Server webhook, public and installations payloads are typed serde
  structs; public redaction rebuilds credentialed metadata exhaustively.
- Batch report names have one grammar; copier's git runs through
  patchula_process with GIT_TIMEOUT.
- The TUI applies the same applicable-subset plan as patchula apply.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 31 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread crates/lookup/src/lib.rs Resolved
Comment thread crates/cli/tests/cli.rs Resolved
Comment thread crates/cli/src/copier.rs Resolved
Comment thread crates/words/src/lib.rs Resolved
Comment thread crates/server/src/public/tests.rs Resolved
@sweepies
sweepies merged commit 867e2d8 into main Nov 9, 2026
12 checks passed
@sweepies
sweepies deleted the refactor/cli-server-leftovers branch November 9, 2026 21:42
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant