docs: replace hardcoded developer paths with /path/to placeholders - #15
Merged
Conversation
abrichr
force-pushed
the
fix/hardcoded-founder-paths
branch
from
August 27, 2026 18:35
ab3afec to
a922ffb
Compare
abrichr
force-pushed
the
fix/hardcoded-paths-in-docs
branch
from
August 27, 2026 18:36
92d2c5b to
0136b2b
Compare
291 occurrences across 51 markdown files pointed at one developer's home directory. A reader who copies `cd /Users/abrichr/oa/src/openadapt-viewer` gets "no such file or directory", so every one of those commands was already broken for everyone else; they just failed at the shell instead of in CI. The substitution is mechanical and 1:1. `/Users/abrichr/oa/src` becomes `/path/to`, which is the placeholder 16 of these files already used in the places that got it right. Absolute paths stay absolute, so `cd`, `open`, `ls`, `file://` URLs and the JSON examples all remain valid templates. Repo-relative rewrites would read better in the "**File**:" references, but that means judging context at 291 sites across files I have not read end to end, and a wrong guess there silently changes what a document claims. Two cases needed their own rule. `/Users/abrichr/.openadapt/catalog.db` is home-relative rather than checkout-relative, so it becomes `~/.openadapt`. `--waa-path /Users/abrichr/oa/WindowsAgentArena` sits one directory above the checkout root. BENCHMARK_VIEWER_ISSUES.md also pasted `ps aux` output carrying the account name. That is the same leak without a leading slash, so the path rules missed it. It now reads `youruser`. tests/test_no_hardcoded_paths.py drops its markdown exemption and covers .md along with code. Verified by planting a violation in a root document and in docs/, with the tree otherwise clean.
abrichr
force-pushed
the
fix/hardcoded-paths-in-docs
branch
from
August 27, 2026 19:03
0136b2b to
a65256c
Compare
abrichr
added a commit
that referenced
this pull request
Aug 28, 2026
The first pass verified everything against openadapt-viewer==0.2.0 from PyPI and documented two bugs that main has already fixed. #15 replaced the hardcoded DEFAULT_CAPTURE_PATH with $OPENADAPT_CAPTURE_RECORDING, and #17 and #19 moved the readers from the pre-#28 capture.db to recording.db. Reciting the wheel's behaviour also tripped tests/test_no_hardcoded_paths.py, which bans an absolute home path in any tracked file including documentation. Everything is now re-run against an editable install of this branch: the demo screenshot, the component signatures in docs/COMPONENTS.md, the benchmark invocation, and the offline behaviour with cdn.jsdelivr.net aborted in a headless browser. The legacy-capture path replaces the stale hardcoded-path bullet, because it is a live failure: LegacyCaptureError subclasses FileNotFoundError, so the fallback in generate_benchmark_html catches it, load_benchmark_data returns a run with zero tasks, and the CLI prints "Generated:". The migration command that recording_db raises never reaches the person who needs it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
abrichr
added a commit
that referenced
this pull request
Aug 28, 2026
* docs: rewrite the README around one worked example The old README opened with six bolded-lead feature bullets, then documented capabilities this package does not have. The audio-transcript section described a feature of openadapt-capture: the string "transcript" appears nowhere in openadapt-viewer's source or in the 0.2.0 wheel. The four README screenshots were produced by scripts/generate_readme_screenshots.py, which calls openadapt_capture.visualize.html.create_html, so they showed another package's output with captions pointing at a transcript panel that is not in the images. The synthetic-demo section told the reader to open synthetic_demo_viewer.html and linked SYNTHETIC_DEMOS_EXPLAINED.md; neither file exists in the repository. SEARCH_FUNCTIONALITY.md was linked at the root and lives under docs/. Everything in the new file was run against openadapt-viewer==0.2.0 installed from PyPI into an empty venv, and the pasted output is that run's output. The component signatures move to docs/COMPONENTS.md, read out of the installed package with inspect.signature rather than copied from the source tree. The screenshot is the real output of `openadapt-viewer demo`, regenerated by scripts/generate_demo_screenshot.py. Four behaviours that the old README's "works offline, no server required" claim covered up are now written down: the page fetches Alpine from jsdelivr and the task list does not render without it; `benchmark` with no --data resolves an absolute path on one developer's machine; the capture viewer emits repo-relative href/src for episode_timeline.css and .js; and __version__ still reports 0.1.0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs: describe main, not the released 0.2.0 The first pass verified everything against openadapt-viewer==0.2.0 from PyPI and documented two bugs that main has already fixed. #15 replaced the hardcoded DEFAULT_CAPTURE_PATH with $OPENADAPT_CAPTURE_RECORDING, and #17 and #19 moved the readers from the pre-#28 capture.db to recording.db. Reciting the wheel's behaviour also tripped tests/test_no_hardcoded_paths.py, which bans an absolute home path in any tracked file including documentation. Everything is now re-run against an editable install of this branch: the demo screenshot, the component signatures in docs/COMPONENTS.md, the benchmark invocation, and the offline behaviour with cdn.jsdelivr.net aborted in a headless browser. The legacy-capture path replaces the stale hardcoded-path bullet, because it is a live failure: LegacyCaptureError subclasses FileNotFoundError, so the fallback in generate_benchmark_html catches it, load_benchmark_data returns a run with zero tasks, and the CLI prints "Generated:". The migration command that recording_db raises never reaches the person who needs it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs: drop two capability claims the generator does not implement The offline section said benchmark --standalone embeds Plotly. The flag is dead: cli.py passes it to generate_benchmark_html, which passes it into _generate_viewer_html, whose body never reads it. PageBuilder is built with include_alpine=True and no include_plotly, so the Plotly branch never runs and the two renderings are byte identical. Claiming an offline escape hatch inside the section about not being offline-safe is the worst place for it. dark_mode is stored in PageBuilder.__init__ and never read again. The sun button in the header is what switches the palette. Say that instead. Add the screenshot-path bullet: the benchmark viewer writes a real recording's screenshots as absolute local paths, so mailing that file loses the images. Only demo inlines them as data URIs. The demo's pass and fail values come from an unseeded random.random(), so 90.0% is not impossible, only unlikely. Soften the caption. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #14, which fixed the code and left the docs. This does the docs: 291 hardcoded paths across 51 markdown files.
Merge #14 first. This branch is stacked on it, so the diff here is docs plus one change to the guard test. Base will retarget to
mainautomatically once #14 lands.Why this isn't cosmetic
A reader who copies
cd /Users/abrichr/oa/src/openadapt-viewerout ofCLAUDE.mdgets "no such file or directory". Same for thels,open,cpand--results-direxamples. Those commands were already broken for everyone except one person. They just failed at the shell instead of in CI, so nobody filed it.What the substitution does
/Users/abrichr/oa/srcbecomes/path/to, one for one, 292 lines in and 292 out. That placeholder isn't invented: 16 of these files already use/path/to/recordingand/path/to/screenshot.pngin the spots that got it right.Paths stay absolute, so
cd,open,ls,file://URLs and the JSON examples all stay valid as templates.file:///path/to/openadapt-capture/...is still a well-formedfile://URL.I considered rewriting the
**File**: /Users/.../openadapt-viewer/foo.htmlreferences as plain repo-relativefoo.html, which reads better. I didn't. That means judging context at 291 sites across 51 files I haven't read end to end, and a wrong call there quietly changes what a document claims. Mechanical and checkable beat nicer and risky at this volume. Happy to do a second pass on the highest-traffic files if you want them prettier.Three cases the main rule missed
/Users/abrichr/.openadapt/catalog.dbis relative to home, not to the checkout, so it became~/.openadapt/catalog.db. Rewriting it as/path/towould have been wrong.--waa-path /Users/abrichr/oa/WindowsAgentArenasits one level above the checkout root.BENCHMARK_VIEWER_ISSUES.md:34pastesps auxoutput starting with the bare account name. Same leak, no leading slash, so the path rules skipped it. Nowyouruser.Guard
tests/test_no_hardcoded_paths.pydrops its markdown exemption. #14 added it with.mddeliberately out of scope because the docs were still dirty; they aren't now, so the exemption goes. This is the reason the branch is stacked rather than cut frommain: both PRs would otherwise create the same file and conflict.Verified by planting a violation in a root document and in
docs/, on an otherwise clean tree, and confirming a clean tree passes.#13 merged mid-way through, so both branches are rebased on it and the guard's allowlist is empty. No tracked file is exempt any more.
Result
No tracked file in the repo contains
/Users/or/home/, and the stringabrichrno longer appears in any markdown.pytest tests/gives145 passed, 46 skipped.ruff check .passes.One thing I got wrong
My first pass at verifying the guard used
git checkout <file>to remove a planted violation, which also discarded that file's sweep.DELIVERABLES.md(29 paths) anddocs/SETUP.md(6) silently reverted. Caught it because the guard failed on what should have been a clean tree, re-applied, and switched to a copy-and-restore for the remaining checks. Worth knowing if you spot-check the diff: those two files were swept twice.