pmacs/docs
Levi Neuwirth 1694908e9c fix(packages): basename-collision reject, SHA-256 cache key, timeout thread join, commit→revision, dead-code (F-005/F-009–F-012)
Package-manager hardening sweep from the repo audit — one Medium + four
Lows, all in src/packages/ (F-011 also renames across lua_bindings + tests).

F-005 (Medium) — install dirs are named by package basename and require
routes by basename, so two distinct packages `owner/magit` and
`other/magit` collapse to one dir with most-recent-install silently
winning. Reject a resolve plan that contains distinct names sharing a
basename: new ResolveError::BasenameCollision + find_basename_collision()
in into_plan (the one place holding every name at once). The loader's
*intended* cross-scope override (project- vs user-scope, most-recent-first)
is untouched — its test still passes. Namespace-preserving layout and
cross-resolve install-time detection are named-deferred.

F-009 (Low) — the fetch bare-mirror cache dir was keyed by 64-bit FNV-1a
of the (attacker-adjacent) repo URL — trivially collidable. Swap to
SHA-256 (sha2, already a dep for lockfile hashing). normalize_url still
folds equivalent URLs to one entry; only the digest changes (re-clones
once, it's a cache).

F-010 (Low) — on a git subprocess timeout, run_with_timeout returned
before joining the stdout/stderr drain threads (joined only on the normal
path), leaving detached readers. Restructure to break the wait loop with a
Result, reap the child on every path, and join both threads at one point
before propagating.

F-011 (Low) — ResolvedPackage.commit was documented "Full 40-character
commit hash" but commit_for_tag() puts a tag string there (the resolver
works against commit-ishes by design, deferring SHA resolution to the
installer/lockfile). Rename the field to `revision` + honest doc.
Compiler-driven rename hit exactly the ResolvedPackage sites; the
Lua-visible "commit" record key is unchanged.

F-012 (Low) — the topo sort built an indegree map, argued in comments it
was backwards, and rebuilt it. Delete the dead first block + the
meandering narration.

Framing/as-built: docs/package-manager-hardening-framing.md.

Validated: fmt clean; clippy --all-targets clean under both Lua flavors;
1436 lib unit tests pass (incl. new F-005/F-009 tests, the F-010 timeout
test, and the loader override test).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014TXbAwk27agwhrNNrhLi2U
2026-07-03 18:47:23 -04:00
..
context-menu-framing.md docs: right-click context menu framing + as-built (Q#CM) 2026-06-27 22:19:00 -04:00
cua-typeover-undo-framing.md CUA type-over is a single undo step (Q#U1) 2026-06-15 20:00:53 -04:00
gpu-attach-robustness-framing.md fix(gpu): F-008 fail-fast must actually tear down the session, not just flag it 2026-07-03 17:14:14 -04:00
gpu-chord-forwarding-framing.md docs: GPU general chord forwarding framing + as-built (Q#GC) 2026-07-03 10:05:55 -04:00
gpu-golden-harness-framing.md docs: GPU headless render harness framing + as-built (Q#GH) 2026-07-03 12:15:19 -04:00
gpu-minibuffer-framing.md docs: GPU minibuffer framing + as-built (Q#MB) 2026-06-30 21:03:32 -04:00
in-buffer-search-framing.md docs: consolidate in-buffer search framing (substring + regex) 2026-06-27 15:03:31 -04:00
mcp-for-package-authors.md M9 ship gate 2026-05-09 15:04:23 -04:00
package-author-guide.md V0.2-prerequisite pull-forward + M10.11 clean audit round 2026-05-18 10:31:31 -04:00
package-manager-hardening-framing.md fix(packages): basename-collision reject, SHA-256 cache key, timeout thread join, commit→revision, dead-code (F-005/F-009–F-012) 2026-07-03 18:47:23 -04:00
packages.md Fix CI and Documentation issues 2026-05-04 10:19:19 -04:00
pmacs-gpu-design.md audit remediation: workspace clippy gate + stale metadata + cruft (F-001/F-013/F-015) 2026-07-03 10:31:17 -04:00
pmacs-gpu-diagnostic-parity-framing.md framing: pmacs-gpu diagnostic parity — quad squiggles, minimap marks 2026-06-12 10:00:06 -04:00
pmacs-gpu-mouse-deferred-framing.md framing: mouse deferred set — triple-click, Shift-click, minimap jump, edge auto-scroll 2026-06-12 12:12:18 -04:00
pmacs-gpu-mouse-framing.md session M-1 — Pointer wire + daemon byte-space mouse semantics 2026-06-10 13:10:17 -04:00
pmacs-gpu-perline-reshape-framing.md session R — per-line incremental reshape (typing latency floor) 2026-06-10 15:01:51 -04:00
pmacs-gpu-phase-a-audit.md Close pmacs-gpu phase A audit 2026-05-28 12:49:23 -04:00
pmacs-gpu-quad-backgrounds-audit.md docs: close quad-backgrounds arc — audit + framing status 2026-05-29 10:49:21 -04:00
pmacs-gpu-quad-backgrounds-framing.md docs: close quad-backgrounds arc — audit + framing status 2026-05-29 10:49:21 -04:00
pmacs-gpu-scroll-framing.md docs: viewport-scoped rendering + scroll framing (perf) 2026-05-30 10:28:59 -04:00
pmacs-gpu-status-band-framing.md framing: GPU status band — local freshness + v8 StatusFacts 2026-06-12 13:45:12 -04:00
pmacs-gpu-wavy-squiggles-framing.md pmacs-gpu: wavy diagnostic squiggles (Q#W1) 2026-06-15 18:41:56 -04:00
project.md Fix PTY final-output drain race 2026-05-04 09:44:30 -04:00
repository-audit-2026-07-03.md fix(gpu): F-004 AltGr strip → Ctrl+Alt only; run pmacs-protocol tests in CI 2026-07-03 14:38:19 -04:00
semantic-frontend-protocol.md M1+M2: FileStyleSummary (minimap producer, Q#2 resolved) + doc 2026-05-19 19:23:20 -04:00