Commit Graph
262 Commits
Author SHA1 Message Date
Jim Lancaster 0e43094b80 Refine Settings page
Quality Gate / gate (push) Failing after 49s
2026-08-24 17:16:40 -05:00
Jim Lancaster c05c054b94 Refine Settings page
Quality Gate / gate (push) Failing after 47s
2026-08-24 17:08:09 -05:00
Jim Lancaster c0112c2714 Add ability to edit safe .env.example options to Settings
Quality Gate / gate (push) Failing after 47s
2026-08-24 16:14:49 -05:00
Jim Lancaster 96af7b2dc0 Minor UI refinement
Quality Gate / gate (push) Failing after 49s
2026-08-24 12:58:34 -05:00
Jim Lancaster 9a7970c533 UI refinement: Back buttons
Quality Gate / gate (push) Failing after 49s
2026-08-24 12:44:02 -05:00
Jim LancasterandCopilot App f15c9834e4 Remove completed remediation handoff and mark the review closed
Quality Gate / gate (push) Failing after 47s
The handoff brief was a work order for phases 2-5. That work is done, so the
document now describes a future that already happened and would misdirect
anyone who found it.

The review report itself had the same problem in weaker form: its findings read
as open. Adds a status banner marking it closed and retained for reasoning only.

The banner also records that two of its recommendations were wrong on contact.
The HIGH-03 fix as written would have stripped root-cause data from
ExecutionAttempt provenance, and the HIGH-01 fix had to preserve per-page
durability the report never mentioned. Leaving that unstated invites someone to
'restore' the report's version later.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 19:25:39 -05:00
Jim LancasterandCopilot App 2c59cbd2c7 Add AGENTS.md to make repo context auto-discoverable
Nothing in this repo was auto-read by an agent at the start of a session.
The .github/instructions files only attach once a matching file is edited,
which is too late to steer strategy, and the canonical docs set is not
discoverable without already knowing to look for it.

AGENTS.md routes rather than duplicates: it states the authority order
(docs/* first, docs/reviews/** explicitly non-canonical), the uv-only
command set, the test-enforced boundaries, and the change protocol.

The Traps section records failure modes this codebase has actually produced
rather than generic advice: the message/detail split that leaked paths in one
direction and degraded provenance in the other, the two competing atomicity
invariants in workflows.py where the obvious simplification breaks multi-page
durability, and the habit of changing a shared symbol without enumerating its
consumers.

Verified: cited test paths exist, full suite passes, ruff/ty clean.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 19:23:26 -05:00
Jim LancasterandCopilot App 5ff66a8c40 Align python-reviewer agent with the python-code-reviewer skill
The agent file had drifted from the skill it delegates to, in two ways that
would corrupt a review run.

Report target: the agent said write reports to ./docs, but the skill targets
./docs/reviews/<date>-code-review.md and explicitly marks docs/reviews/** as
non-canonical. Following the agent would place a dated, opinionated review
inside the canonical authority set that findings are supposed to resolve
against.

Verification commands: the agent said run 'ruff check', 'pytest', and 'ty'.
None are on PATH in this uv project, so an agent following its own instruction
gets command-not-found and is pushed toward guessing instead of verifying.

The agent now defers to the skill for all specifics rather than restating them,
which is what let the two copies drift apart. Also carries forward the
consumer-tracing rule and states the read-only scope explicitly.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 19:17:33 -05:00
Jim LancasterandCopilot App 626b5d4b10 Harden python-code-reviewer skill with lessons from executing its own review
Three gaps surfaced by implementing the 2026-08-23 review's recommendations.

1. Recommendations were never verified the way claims were. The report's fix for
   the error path leak would have stripped root-cause data from evidence records,
   because the review traced one consumer of AppError.message and missed that
   format_error_detail writes it to ExecutionAttempt.error_detail. Adds workflow
   step 9 (validate recommendations against consumers), a Blast Radius field on
   findings, and the worked example so the failure mode is concrete.

2. Fixes that sit between competing invariants were not flagged. The atomicity
   recommendation did not note that per-page durability and terminal-status
   atomicity pull in opposite directions, so the obvious simplification silently
   breaks multi-page durability. Recommendations must now name both invariants,
   the test guarding each, and the over-correction to avoid.

3. Severity could not express reachability. Two findings were latent behind a
   default setting and a single-instance deployment, which is a sequencing
   constraint: they must be fixed before the change that makes them live. Adds an
   explicit Reachability field with Live / Latent / Theoretical.

Verified: meta contract guards and traceability tests pass.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 19:14:35 -05:00
Jim LancasterandCopilot App 12f125761a test: invert UI boundary guard to allowlist
Quality Gate / gate (push) Failing after 47s
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:57:13 -05:00
Jim LancasterandCopilot App 803237371e fix: log omitted OpenRouter request manifests
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:55:33 -05:00
Jim LancasterandCopilot App d4ae97c1b1 chore: remove uncertain orphaned definitions
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:53:54 -05:00
Jim LancasterandCopilot App c52d41ec33 test: extend orphan sweep to public class methods
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:52:06 -05:00
Jim LancasterandCopilot App 6c3eac0a44 test: prune low-signal assertions and tighten guards
Quality Gate / gate (push) Failing after 47s
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:48:16 -05:00
Jim LancasterandCopilot App e5410708e4 refactor: extract blocking and sequence retry helpers
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:46:19 -05:00
Jim LancasterandCopilot App efbae26f16 refactor: route workflow sessions through unit of work
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:43:07 -05:00
Jim LancasterandCopilot App 3873810022 perf: move blocking homepage and hash I/O off loop
Quality Gate / gate (push) Failing after 47s
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:41:01 -05:00
Jim LancasterandCopilot App 2093eb6fb3 fix: retry execution attempt number conflicts
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:35:59 -05:00
Jim LancasterandCopilot App f9261a1af3 fix: derive worker shutdown wait from timeout budget
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:32:40 -05:00
Jim LancasterandCopilot App 86cdb4035c fix: gate retries by error category with backoff
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:30:54 -05:00
Jim LancasterandCopilot App f193b2800b feat: run stale-job recovery periodically
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:28:21 -05:00
Jim LancasterandCopilot App 736d0c06f4 chore: enable logging format lint rule
Quality Gate / gate (push) Failing after 48s
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:19:05 -05:00
Jim LancasterandCopilot App 26f9c83f54 chore: make ty check blocking with targeted suppressions
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:17:44 -05:00
Jim LancasterandCopilot App a2bb1acd6b chore: enforce ruff format in pre-commit
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:14:52 -05:00
Jim LancasterandCopilot App 2a56365847 style: apply ruff formatting sweep
Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:13:38 -05:00
Jim LancasterandCopilot App 4aaa9bd581 Add remediation handoff brief for review phases 2-5
Quality Gate / gate (push) Failing after 47s
Records the implementation plan derived from the 2026-08-23 review: per-task
acceptance criteria, the verification baseline, and environment constraints.

Lives in docs/reviews/ so it is discoverable from the repo rather than from
session state, and is indexed from docs/reviews/README.md. Non-canonical, like
everything under docs/reviews/**.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:04:55 -05:00
Jim LancasterandCopilot App de18c2e9da Fix workflow commit atomicity, error path leak, and UI error boundary
Quality Gate / gate (push) Failing after 48s
Phase 1 of docs/reviews/2026-08-23-code-review.md.

HIGH-01: process_queued_job committed page evidence and the terminal job
status in separate transactions, so a crash between them left a transcript
persisted against a job stuck in PROCESSING that the worker never reclaims.
The final page's write is now deferred into _finalize_batch_outcome so it
shares the terminal transaction. Intermediate pages remain individually
durable, and the terminal commit is shielded against cancellation the same
way per-page writes already were.

HIGH-04: added tests/integration/test_pipeline_atomicity.py covering both
Transaction B and Transaction C. Confirmed failing against the previous
implementation before the fix.

HIGH-03: classify_unexpected_error interpolated the raw exception into
AppError.message, which the UI renders and the API serializes, leaking the
database path from OperationalError. message is now generic. Because message
also feeds format_error_detail, which writes evidence records, the root cause
is preserved on a new internal-only AppError.detail field rather than
discarded.

HIGH-02: replaced 8 hand-rolled ui.notify error calls in home_page and
people_page with error_presenter.show_error, restoring the correlation
error_id, canonical category, and suggestion. Added an AST guard to
test_ui_boundaries.py so pages cannot hand-roll error notifications again.

Docs updated per documentation-sync: the message/detail split in
docs/error_handling.md and the multi-page atomicity rule in
services.instructions.md.

Verification: ruff clean, 381 tests passing, ty unchanged at 10 known
SQLAlchemy descriptor false positives.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 18:02:04 -05:00
Jim LancasterandCopilot App 8d3c60fce1 Add 2026-08-23 architecture and code review report
Quality Gate / gate (push) Failing after 46s
Full review per .github/skills/python-code-reviewer/skill.md, with escalations to the evidence-provenance-auditor and test-effectiveness-auditor skills.

Verification: ruff clean, 377 tests passing, 10 advisory ty diagnostics.
Outcome: 0 critical, 4 high, 5 medium, 11 low.

Report only; no source changes.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 17:13:10 -05:00
Jim LancasterandCopilot App 8a30231adf Triage high-value ty diagnostics
Quality Gate / gate (push) Failing after 47s
Apply the highest-value typing fixes from the ty baseline pass:
- align migration row typing with SQLAlchemy RowMapping sequences
- accept refreshable callback return type in homepage gallery
- guard nullable media URL before ui.image in people photos
- guard nullable source MIME type before startswith checks
- fix tests/test_db collect() return annotation to match 4-tuple

This clears all actionable ty findings from that set and leaves only
known SQLModel/SQLAlchemy descriptor false positives.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 16:54:34 -05:00
Jim LancasterandCopilot App 67feeb28af Repair the pre-commit quality gate and clear the ruff backlog
Quality Gate / gate (push) Failing after 47s
The pre-commit hooks declared `language: system` with bare `ruff`/`ty`
entries, but both are uv-managed dev dependencies and are not on PATH, so every
commit failed with `Executable 'ruff' not found`. Route both through
`uv run`; keep ruff blocking and make ty advisory (verbose) until its 18
whole-project diagnostics are cleared.

With the gate working, clear `ruff check .` to zero:

- 18 auto-fixes (import sorting, blank lines, `max()` simplification,
  `with` merging, unused imports).
- Real defects: `SourceNavigation` annotated but never imported in
  sources_page; two naive `datetime.now()` calls in migration.py now use
  `datetime.now(UTC)`.
- Dead parameters removed: `source_has_photo_table` (computed, passed, never
  read), `_serialize_value(key=...)`, and unused `request` on two NiceGUI
  page handlers where the framework injects it optionally.
- Mechanical line-length wrapping and one `startswith` tuple collapse.
- `# noqa: PLR0915` / `# noqa: PLR1702` on five long UI/migration
  functions, following the convention already used in jobs_page and
  settings_page, rather than refactoring during stabilization.

Full suite green (377 tests, `-m "not external"`).

Co-authored-by: Copilot App <[email protected]>
2026-08-23 16:47:11 -05:00
Jim LancasterandCopilot App c6ed3126e0 Enforce the four unenforced reviewer checks with guard tests
The reviewer skill recorded four deterministic checks as unenforced or partial. Add tests so they fail the build instead of relying on a reviewer noticing.

tests/test_model_contract_guards.py:
- Status vocabulary: flags string literals compared against or assigned to status/purpose attributes, plus a narrower sweep that requires every status-valued literal in the package to be a known non-status use.
- Relationship loading: every Relationship must declare lazy='raise' except documented exceptions, and the exception set must match the Relationship Loading Contract in docs/schema.md.
- Schema fidelity: the Field-Accurate Table Contracts tables must match db/models.py on table coverage, field names, and declaration order, and the Authoritative Enumerations section must match the enum members.

tests/test_orphan_sweep.py:
- Locks the set of unreferenced public definitions. Route handlers registered by decorator are exempt, string entrypoint references count, and tests/ and tools/ count as consumers. KNOWN_ORPHANS records the four current orphans with rationale; a new one fails the build.

Each guard was mutation-tested: reverting the fix below, dropping a documented field, widening a lazy strategy, and adding a stranded function each fail their respective test.

Also fix the one violation the status guard found: sources_page.py compared attempt.status.value to the literal 'transcribed' instead of JobSourceStatus.TRANSCRIBED, which would survive an enum rename.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 16:35:48 -05:00
Jim LancasterandCopilot App 5566f48fc0 Align python-code-reviewer skill with repo ground truth
Quality Gate / gate (push) Failing after 11s
Update the reviewer skill so its procedure matches how this repo actually works:

- Route review reports to docs/reviews/ and mark them non-canonical, resolving the conflict where reports landed in the same docs/ tree they resolve findings against.
- Pin verification commands to uv (uv run ruff check / ty check / pytest -m 'not external').
- Record the pytest contract: strict markers, strict asyncio mode, and the never-awaited-coroutine warning promoted to an error.
- Convert the deterministic checks to a table with an Enforced by column; three checks are unenforced and one only partial, which are now findings by construction.
- Add a consequence-based severity rubric and a Direction column for bidirectional drift.
- Escalate test-suite concerns to test-effectiveness-auditor.

Also fix tests/test_db.py, which was missing 'from sqlalchemy import text' while using it in 14 places. Three tests were failing with NameError. Wrapped the pre-existing long lines in the same file so it lints clean.

Document the deliberate nicegui==3.13.0 pin in pyproject.toml, a new runbook dependency upgrade policy, and the reviewer skill, so the pin is not flagged as a defect or widened as incidental cleanup.

Co-authored-by: Copilot App <[email protected]>
2026-08-23 16:27:44 -05:00
Jim Lancaster ed6998d8da V5.1 Update tests and documentation
Quality Gate / gate (push) Failing after 11s
2026-08-23 16:01:53 -05:00
Jim Lancaster ebf659b26c V5.1 UI refinements
Quality Gate / gate (push) Failing after 11s
2026-08-23 15:28:41 -05:00
Jim Lancaster ae3483ec2e V5.1 Modify Person table: split full name into first & last, added tags support
Quality Gate / gate (push) Failing after 11s
2026-08-23 12:23:57 -05:00
Jim Lancaster 141ee1fa85 V5.0 Minor change to UI
Quality Gate / gate (push) Failing after 11s
2026-08-23 10:49:40 -05:00
Jim Lancaster 0f30d902b9 V5.0 fixes and revisions
Quality Gate / gate (push) Failing after 11s
2026-08-23 10:32:20 -05:00
Jim Lancaster 86b8e83ff4 v5.0 Introduce centralized homepage & portrait photo management
Quality Gate / gate (push) Failing after 11s
2026-08-23 09:11:36 -05:00
Jim Lancaster efe7785392 Fix document drift caused by adding tags 2026-08-23 06:46:43 -05:00
Jim Lancaster 94db493756 Revise Source detail page to improve line-wrap issues.
Quality Gate / gate (push) Failing after 11s
2026-08-22 18:56:22 -05:00
Jim Lancaster 0d554c0648 V4.11 Added tags + lots of little changes to the UI
Quality Gate / gate (push) Failing after 12s
2026-08-22 18:32:52 -05:00
Jim Lancaster 63c21d4a14 v4.10 revision to remove "legacy compatibility" code
Quality Gate / gate (push) Failing after 11s
2026-08-22 11:21:18 -05:00
Jim Lancaster cf49c3c127 V4.10
Quality Gate / gate (push) Failing after 11s
2026-08-22 10:19:30 -05:00
Jim Lancaster bf2f3ac09c Remove references to "v4" throughout the code and documentation
Quality Gate / gate (push) Failing after 11s
2026-08-20 16:35:20 -05:00
Jim Lancaster eaeb0bc806 claude-sonnet-5 review: Phase 5 (final) implemented by gpt-5.3-codex
Quality Gate / gate (push) Failing after 37s
2026-08-20 16:14:44 -05:00
Jim Lancaster 8b08478c9d claude-sonnet-5 review: Phase 4 (by gpt-5.3-codex)
Quality Gate / gate (push) Failing after 11s
2026-08-20 16:04:37 -05:00
Jim Lancaster 450d33d507 claude-sonnet-5 review Phase 3 (by gpt-5.3-codex)
Quality Gate / gate (push) Failing after 11s
2026-08-20 15:36:17 -05:00
Jim Lancaster 796216087c claude-sonnet-5 review: Phase 2 by gpt-5.3-codex
Quality Gate / gate (push) Failing after 11s
2026-08-20 15:22:23 -05:00
Jim Lancaster afd1dba4d4 Phase 1 - minor fix to Sources page
Quality Gate / gate (push) Failing after 11s
2026-08-20 15:14:34 -05:00
Jim Lancaster 7daa0b9808 claude-sonnet-5 review: Phase 1 implemented by gpt-5.3-codex
Quality Gate / gate (push) Failing after 12s
2026-08-20 15:05:17 -05:00