Everything is verified green. Final report: **Phase 106 — Document dates (final verification pass; all 10 tasks already complete)** - Verified all phase artifacts: alembic `0020` (dev DB at `0020`), `doc_dates.py`, git `file_commit_dates`, importer `doc_dates_by_root`/`dates_updated`, both entry-point wirings, date APIs + tree `created_at`/`updated_at`, LLM surfaces (prompt block, `read` line 2, appended `ls` field), `apply_recency_boost` in `retrieve()`, UI columns/badge, admin editor, mock-LLM regex — all present and correct; no defects found, no fixes needed. - `uv run pytest --cov=app --cov-report=term-missing` → **2299 passed, TOTAL 99%** (>90% ✓) - `uv run pytest tests/e2e/test_document_dates.py -v --no-cov` → **6/6 passed** in isolation (DB up) - 12 regression E2E suites (retrieval_quality, whole_document_context, agent_document_tools, ls_tree_drilldown, read_truncation_cap, kb_tree, kb_tree_nav, document_viewer, edit_summaries, import_documents, sync_button, hidden_folders_toggle, smoke) → **all green in isolation** - `uv run ruff check .` → clean; `uv run pyright` → **0 errors, 0 warnings** **Completion criteria:** 1) non-null `created_at` + 0020 upgrade/downgrade on dev DB ✓ (real-Alembic integration tests) 2) sync refresh/older/manual-persists/content-reset/no sources_meta bump ✓ 3) zip/tar mtime + future→today ✓ 4) LLM date surfaces + cross-check ✓ 5) UI Created/Updated/badge positions ✓ 6) admin editor set+revert round-trip ✓ 7) old-correct-beats-new-similar (defaults & boost-off) + near-tie + `BOR_RECENCY_BOOST=0` byte-identical ✓ 8) full gate ✓ 9) commit/phase-move — left to harness per instructions. - **Notable:** recency default tuned 0.001 → **0.0007** (task 07 step 5 explicitly permits; measured margins recorded in `test_recency_boost.py` docstring). - **Next pending phase:** none — `todo/` holds only this phase.
6.0 KiB
6.0 KiB
Task 08 — UI: Created file column, Updated folder column, viewer Created badge (D8)
Phase: 106_document_dates · Source: owner request 2026-09-13 — "The UI must also show a date for every document at the top of that document when the user clicks it"; "I would also like to see a last updated dates/timestamps on folders before the description column but after the documents column in the UI"; "For files, include a date/timestamp before the 'indexed' column in the UI."
Objective
Render the dates the task-05 APIs serve: the file table's Created column (before Indexed), the folder/source table's Updated column (after Documents, before Description), and the clicked document's Created badge in the shared viewer core's top meta row (modal + full page). The date EDITOR is task 09 — this task ships display only.
Work
frontend/index.html— the two header rows (RAG view):- File table (L485-492): insert
<th scope="col">Created</th>between<th scope="col">Chunks</th>and<th scope="col">Indexed</th>. - Folder table (L470-478): insert
<th scope="col">Updated</th>between<th scope="col">Documents</th>and<th scope="col">Description</th>. (No other shell markup — the rows are built by JS; a brief phase-106 comment above each inserted<th>in the house style.)
- File table (L485-492): insert
frontend/assets/sources.js:makeRow(L1375-1410): the cell loop (L1401) becomesfor (const value of [d.title, String(d.chunks), fmtDate(d.created_at), fmtDate(d.indexed_at)])— theCreatedcell lands BEFOREIndexed(D8 verbatim). The loop's plain-tdshape can't carry per-cell titles, so the date cells get one refinement: build theCreatedcell explicitly (atdwithtextContent = fmtDate(d.created_at)ANDtitle = d.created_at— the ISO hover/precision value, the path-celltitleidiom) between thechunksandIndexedcells (the E2E asserts on the locale-stabletitle, not ontoLocaleStringoutput). The row object fed from tree file nodes (L1341-1350) gainscreated_at: f.created_at(task 05's tree shape — the flatGET /api/docspath, ifmakeRowis still fed from it anywhere, carriescreated_attoo — grepmakeRow(call sites and extend every one).makeSourceRow(L1217-1235) +makeFolderRow(L1237-1261): between the counttdand the description cell, one newtd—const updatedTd = document.createElement("td"); updatedTd.textContent = s.updated_at ? fmtDate(s.updated_at) : "–";(thestatLastnull idiom, L1294 —Nonefor a 0-document source, D9).titleattribute = the ISO value (hover precision on the ellipsized cell, themakeRowpath-cell idiom).renderLevel/treeStats— UNCHANGED (the stat cards keep theirindexed_at"last indexed" semantics — the owner asked for the column, not the cards).
frontend/assets/document.js—renderDocument(L118-176, the ONE shared core — the modal AND/document.htmlrender through it): the.doc-metabadge row (L123-129) gains the badge BEFORE theIndexedone:(the date at the top of a clicked document, D8).metaBadge("doc-created", `Created ${fmtDate(doc.created_at)}`), metaBadge("doc-indexed", `Indexed ${fmtDate(doc.indexed_at)}`),doc-createdis the NEW class — the badge'stitleattribute carries the full ISO timestamp (thetitleElellipsis-precision idiom, L122-124).document-modal.jsneeds no change (it calls the shared core with its ownmetaEl— the module docstring's contract is unchanged; verify the modal's meta element exists — it does:metaElL48).frontend/assets/styles.css— next to the existing.doc-indexedrule (grep for it):.doc-created— same badge family (thedoc-indexedrule copied, provenance comment citing phase 106 D8); the new table cells need no new CSS beyond what.docs-tablealready styles (verify the column count change doesn't break the table's responsive rules — the#docs-table/.kb-folders-tablegrid/width rules: if a rule hard-codes the column count, extend it). WCAG: the date text reuses the table ink (≥4.5:1 by construction — record the verified pair in the comment, house style); the badge contrast mirrorsdoc-indexed's recorded ratio.tests/unit/test_sources_dates.py(NEW — the house read-the-assets-as-text pattern,tests/unit/test_source_ignore_paths.py's sibling style):frontend/index.html— both header rows' cell ORDER pinned (the<th>sequence strings:Source | Path | Title | Chunks | Created | IndexedandFolder | Documents | Updated | Description);frontend/assets/sources.js— themakeRowvalue-list order (created_atbeforeindexed_at), theupdatedTdnull→"–"branch present in BOTH row builders, the file-row object carriescreated_at;frontend/assets/document.js— the badge order in the meta row (doc-createdbeforedoc-indexed), theCreatedlabel +fmtDate(doc.created_at)template, the single-source cross-file check that thedoc-createdclass exists instyles.css;frontend/assets/styles.css— the.doc-createdrule present with a provenance comment.
- Run
uv run pytest tests/unit/test_sources_dates.py -q+ the existing sources/JS unit suites — green.
Testing & Quality
- Unit: the source-level wiring pins above (order, null handling, cross-file class check).
- Coverage: >90% on
app/(noapp/code this task — the gate is the full-suite one, held by the other tasks; the JS pins are the house frontend-test pattern).
Completion Criteria
- The file table shows
CreatedbetweenChunksandIndexed(formatted like theIndexedcell —fmtDate); the folder/source table showsUpdatedbetweenDocumentsandDescription(subtree max from the tree API,–when null) - The clicked document's top meta row carries
Created <date>BEFOREIndexedin BOTH the modal and/document.html(one shared core — no per-surface copy) tests/unit/test_sources_dates.pypins the orders + null branch + cross-file class and passes; existing JS unit suites stay green;uv run ruff check . && uv run pyrightclean