Skip to content

chore: clean repository root layout - #404

Merged
Sinity merged 4 commits into
masterfrom
feature/chore/repo-root-layout
Apr 26, 2026
Merged

Sinity merged 4 commits into
masterfrom
feature/chore/repo-root-layout

Conversation

@Sinity

@Sinity Sinity commented Apr 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Clean the repository root and documentation map without changing the README media system. This PR removes tracked local/editor/cache state, flattens the browser extension directory, replaces the bespoke dateparser type stub with the published stub dependency, and keeps the generated docs surface focused on durable reader paths.

Ref #403

Problem

The repository root mixed source artifacts with local working-state sentinels and editor/agent settings. The browser extension lived under a redundant nested directory, docs still advertised tracked .cache/.local README files, and mypy_path = "stubs" existed only to support a tiny dateparser stub that is better handled as a dev dependency.

The larger audit found deeper structural work in source/provider layout, scenarios/showcase, README media, and product ownership. Those belong in #403, #410, #412, #413, and #414 rather than being partly solved here.

Solution

  • Remove tracked .agent/includes, .cache/README.md, .local/README.md, .claude/settings.json, .vscode/*, and the local stubs/dateparser package.
  • Ignore .cache/, .local/, .claude/, and .vscode/ directly.
  • Move the browser extension from browser-extension/polylogue-browser-capture/ to browser-extension/ and update docs.
  • Add types-dateparser to the dev dependencies and remove mypy_path = "stubs".
  • Update docs-surface rendering/tests so the docs map stays reader-oriented and does not reintroduce tracked local-state docs.
  • Leave README/VHS/media redesign to the scenario-backed documentation work tracked in refactor(scenarios): make scenarios the docs/media/proof catalog #410 and docs: rebuild README as executable product tour #412.

Verification

  • pytest -q tests/unit/devtools/test_render_docs_surface.py -> 2 passed.
  • devtools render-all --check -> sync OK for AGENTS.md, CLI reference, devtools reference, quality reference, verification catalog, and docs surface.

Summary by CodeRabbit

  • Documentation

    • Restructured documentation index with new organizational categories ("Orientation," "User and Integration Surfaces," "Verification and Quality," "Contributor Workflow").
    • Updated browser capture and development tools documentation for clarity.
  • Chores

    • Simplified VS Code workspace configuration and removed Python-specific settings.
    • Updated .gitignore patterns and removed repository guidance documents.
    • Removed direnv dependency wrapper and related development stubs.

Sinity added 2 commits April 25, 2026 23:07
Problem: the README ended with three overlapping navigation surfaces: a docs-map link, a contributor-guides table, and a Development paragraph repeating the same root files. The full docs map was also a flat table, so it duplicated the README without helping readers choose where to go next.

What changed: keep the README docs block to a single curated public-facing table, remove the redundant Development and license tail, and render docs/README.md as a structured map grouped by orientation, user surfaces, verification, contributor workflow, and local state.

Verification: devtools render-docs-surface --check; devtools render-all --check; ruff format --check devtools/render_docs_surface.py devtools/docs_surface.py; ruff check devtools/render_docs_surface.py devtools/docs_surface.py; git diff --check.
Problem: tracked editor settings, cache sentinels, local agent includes, and a one-off dateparser stub made the repository root look noisier than its actual source tree. The browser extension was also nested under a redundant package directory, and docs still linked to tracked cache/output README files.\n\nWhat changed: remove tracked dotdir/cache/local-state files, ignore those roots directly, flatten the browser extension to browser-extension/, replace the root dateparser stub with the normal types-dateparser dev dependency, and update generated documentation surfaces/tests to avoid the removed local-state docs.\n\nFollow-up: source and test module topology needs a deliberate import-aware refactor tracked in #403 rather than a casual rename pass.\n\nVerification: devtools render-all --check; pytest -q tests/unit/devtools/test_render_docs_surface.py; uv run --extra dev mypy polylogue/lib/dates.py --show-error-codes; devtools affected-obligations --path README.md --path docs/browser-capture.md --path docs/README.md --path pyproject.toml --path browser-extension/manifest.json; devtools verify --quick.\n\nRef #403\n\nCo-Authored-By: Codex <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 25, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d836786b-4e58-4005-a32e-2f2def470666

📥 Commits

Reviewing files that changed from the base of the PR and between 6cfa053 and 853d7bb.

📒 Files selected for processing (2)
  • README.md
  • docs/internals.md

📝 Walkthrough

Walkthrough

The PR removes AI agent guidance files, VS Code and Claude IDE configurations, local documentation, and custom type stubs. It reorganizes the documentation structure and updates the docs surface generation logic to reflect new categorization. Type stubs are replaced with official packages via dependencies.

Changes

Cohort / File(s) Summary
Agent & IDE Configuration Removal
.agent/includes/agent-memory.md, .agent/includes/agent-workflow.md, .claude/settings.json, .vscode/direnv-python, .vscode/settings.json
Deletes AI agent workflow/memory guidance and VS Code/Claude tool configurations including pre-tool validation hooks.
Documentation & Guides Cleanup
.local/README.md, README.md
Removes local outputs documentation file and updates README structure, removing "Contributor Guides" and "Development"/"License" sections.
Documentation Structure Reorganization
docs/README.md, docs/browser-capture.md, docs/devtools.md, docs/internals.md
Reorganizes docs index with new sections ("Orientation", "User and Integration Surfaces", "Verification and Quality", "Contributor Workflow"); updates resource paths and removes local README references.
Docs Surface Generation
devtools/docs_surface.py, devtools/render_docs_surface.py
Updates registry entries, removes README_GUIDE_TITLES export, reorders README_DOC_TITLES, and refactors docs rendering with new categorized table helpers.
Build Configuration
.gitignore, pyproject.toml
Updates cache/workspace ignore patterns from file-level to directory-level; adds .vscode/ to ignores; adds types-dateparser>=1.2.0 dependency and removes mypy_path configuration.
Type Stubs
stubs/dateparser/__init__.pyi
Removes custom dateparser type stub file (replaced by official package types).
Test Updates
tests/unit/devtools/test_render_docs_surface.py
Renames test function and rewrites assertions to verify new docs groupings and absence of local cache/output links.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

type:chore, area:docs, tool:claude

Poem

🐰 A hop through the docs, we tidied the heap,
Removing old guidebooks, stubs in a heap,
The AI whispers gone, the VS Code fades,
Fresh documentation structure cascades!
Type stubs say farewell, official ones reign—
Cleaner, simpler, reorganized terrain! 📚✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: clean repository root layout' accurately and concisely summarizes the main change: removing tracked state files, directories, and documentation from the repository root while reorganizing the directory structure.
Description check ✅ Passed The pull request description follows the required template with all major sections completed: Summary explains what changed and why, Problem describes the codebase issue, Solution lists the specific changes made, and Verification provides exact commands run. The description is comprehensive and well-structured.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/chore/repo-root-layout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Problem: the README had one raw terminal recording that leaked setup commands, rendered prompt escapes, moved too quickly, and did not explain the actual workflows. The docs audit also needed durable source/test topology guidance rather than just a loose issue note.\n\nWhat changed: replace the single quickstart GIF with three slower VHS-backed README demos for query, products/publication, and verification routing. Add reproducible media scripts, keep captions inside the recordings, remove the obsolete quickstart tape/GIF, move the static-site screenshot to the publication section, and document the source/test ownership map with #403 as the import-aware cleanup target.\n\nVerification: bash docs/assets/readme/render-readme-media.sh; bash -n docs/assets/readme/readme-demo.sh docs/assets/readme/render-readme-media.sh docs/assets/readme/seed-demo-env.sh; vhs validate docs/assets/readme/polylogue-query.tape docs/assets/readme/polylogue-products.tape docs/assets/readme/polylogue-verification.tape; devtools render-all --check; pytest -q tests/unit/devtools/test_render_docs_surface.py; uv run --extra dev mypy polylogue/lib/dates.py --show-error-codes; git diff --check.\n\nRef #403\n\nCo-Authored-By: Codex <[email protected]>

@coderabbitai coderabbitai 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.

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
devtools/render_docs_surface.py (1)

44-54: 🧹 Nitpick | 🔵 Trivial

Minor: _render_named_table duplicates _select_entries logic.

_select_entries (line 44) and the inline lookup inside _render_named_table (line 54) both build a title→entry tuple from a title list; only the input shape differs (entries tuple vs. precomputed dict). Consider unifying so callers either always go through _select_entries + _render_table, or have _select_entries accept a prebuilt mapping. Not a correctness issue.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@devtools/render_docs_surface.py` around lines 44 - 54,
_refactor:_select_entries to accept either a tuple[DocsEntry,...] or a
dict[str,DocsEntry] (or provide an overload) and centralize the title→entry
selection logic there; then change _render_named_table to call
_select_entries(by_title, titles) and pass the result to _render_table. This
removes the duplicated lookup in _render_named_table while keeping function
names _select_entries and _render_named_table and preserving the existing
title-based selection behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.gitignore:
- Around line 23-26: The .gitignore mixes root-anchored entries (/.cache/,
/.local/) with unanchored patterns (.claude/, .vscode/); to make behavior
consistent anchor the editor/agent entries by changing .claude/ and .vscode/ to
/.claude/ and /.vscode/ so all four patterns are root-anchored, or explicitly
document/keep the current intent if you want caches anchored and editor dirs
matched at any depth.

In `@docs/assets/readme/polylogue-products.tape`:
- Around line 29-31: The Sleep 14s in the products demo is too short and
truncates the site build output; either increase the sleep to cover seeding +
build (e.g., change Sleep 14s to Sleep 40s) or shorten the scene by removing the
heavy step (remove the second run_scene that calls "polylogue --plain run site
-o .local/vhs-readme-products/site-preview" and only show the products listing).
Ensure the chosen wall time covers seed_env (which runs rm -rf + devtools
lab-corpus seed --count 8 --output-dir .local/vhs-readme-products), both
run_scene holds, and the static site build so polylogue-products.gif isn’t cut
off; align the final sleep with the trim offset used in render-readme-media.sh
(8.2s) so post-trim content remains visible.

In `@docs/assets/readme/polylogue-verification.tape`:
- Around line 22-23: The script contains a hardcoded absolute path command `cd
/realm/project/polylogue` which will fail for contributors; remove that `cd` (or
replace it with a no-op like `cd .`) in the recorded tape and instead rely on
the repo-root invocation from `render-readme-media.sh` or accept a working-dir
env var exported by the render script (e.g., read an env var and fallback to
`.`). Update the tape where `cd /realm/project/polylogue` appears and ensure
`vhs` is run from the repo root by `render-readme-media.sh` or pass a directory
via env so recordings are reproducible for others.

In `@docs/assets/readme/readme-demo.sh`:
- Around line 22-36: In run_scene(), the helper spawns a login shell via "bash
-lc \"$command\"" which re-sources user login profiles and can leak local
aliases/PATH; change the invocation to use "bash -c \"$command\"" (i.e., replace
bash -lc with bash -c) so the hermetic VHS shell is preserved and the output
remains reproducible—keep the existing quoting and use of
display_command/command/hold unchanged.

In `@docs/assets/readme/render-readme-media.sh`:
- Around line 7-22: The render_gif function leaves the intermediate palette file
(.local/${name}-palette.png) behind; update render_gif to remove the palette
variable (palette) after use—e.g., add a cleanup step (rm -f "$palette") or set
a trap inside render_gif to unlink "$palette" on exit/ERR—so the .local/
directory is not cluttered; reference the render_gif function and the palette
variable to locate where to add the cleanup.
- Around line 4-22: The script's render_gif function writes files into the
.local directory (variables palette and output) but never ensures that .local
exists, causing ffmpeg to fail on fresh clones; update the render_gif function
(and any caller if present) to create the directory before writing by invoking
mkdir -p .local (or mkdir -p "$(dirname "$palette")") right after computing
local variables (name, trim, input, palette, output) so palette and output can
be created safely.

In `@docs/assets/readme/seed-demo-env.sh`:
- Line 13: The command pipeline that runs devtools lab-corpus seed (the eval
"$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root"
--env-only 2>/dev/null | sed -n '/^export /p')") is currently discarding stderr,
which hides failures; update the pipeline so stderr from devtools lab-corpus
seed is not redirected to /dev/null (either remove "2>/dev/null" or redirect
stderr to a logfile and surface it), preserving the sed filtering of export
lines so that failures from devtools are visible and debuggable while still
producing the expected env exports.
- Around line 1-18: The file seed-demo-env.sh is an unused duplicate of the
seed_env() helper in readme-demo.sh; remove duplication by either deleting
seed-demo-env.sh or merging its logic into readme-demo.sh and updating callers.
If you delete the file, ensure no scripts reference seed-demo-env.sh; if you
merge, copy the readme_caption() function and the environment seeding block (the
eval "$(devtools lab-corpus seed ...)" logic and POLYLOGUE_FORCE_PLAIN/PS1
exports) into readme-demo.sh alongside the existing seed_env() or replace
seed_env() with this consolidated implementation, then remove seed-demo-env.sh
and run a quick repo-wide search for seed-demo-env.sh to confirm there are no
remaining references.
- Around line 9-14: The script ambiguously uses $1 both as a flag and as the
demo_root; modify the argument parsing to handle a real flag (e.g., --no-seed)
first using a while/getopts-style loop or case loop that consumes flags with
shift, set a boolean like no_seed, then after flags are shifted assign
demo_root="${1:-.local/vhs-readme-demo}" and count="${2:-8}"; update the
conditional that runs devtools lab-corpus seed to check the no_seed flag (not
the raw $1) and keep the existing eval "$(devtools lab-corpus seed ...)"
invocation unchanged so callers can pass --no-seed and still override
demo_root/count correctly.

---

Outside diff comments:
In `@devtools/render_docs_surface.py`:
- Around line 44-54: _refactor:_select_entries to accept either a
tuple[DocsEntry,...] or a dict[str,DocsEntry] (or provide an overload) and
centralize the title→entry selection logic there; then change
_render_named_table to call _select_entries(by_title, titles) and pass the
result to _render_table. This removes the duplicated lookup in
_render_named_table while keeping function names _select_entries and
_render_named_table and preserving the existing title-based selection behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6c8bd6ec-f044-4561-8801-e9d0bca1264b

📥 Commits

Reviewing files that changed from the base of the PR and between 855547e and 6cfa053.

⛔ Files ignored due to path filters (6)
  • .cache/README.md is excluded by !**/.cache/**
  • docs/assets/readme/polylogue-products.gif is excluded by !**/*.gif
  • docs/assets/readme/polylogue-query.gif is excluded by !**/*.gif
  • docs/assets/readme/polylogue-quickstart.gif is excluded by !**/*.gif
  • docs/assets/readme/polylogue-verification.gif is excluded by !**/*.gif
  • uv.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (33)
  • .agent/includes/agent-memory.md
  • .agent/includes/agent-workflow.md
  • .claude/settings.json
  • .gitignore
  • .local/README.md
  • .vscode/direnv-python
  • .vscode/settings.json
  • README.md
  • browser-extension/README.md
  • browser-extension/manifest.json
  • browser-extension/src/background.js
  • browser-extension/src/common.js
  • browser-extension/src/content/chatgpt.js
  • browser-extension/src/content/claude.js
  • browser-extension/src/popup.html
  • browser-extension/src/popup.js
  • devtools/docs_surface.py
  • devtools/render_docs_surface.py
  • docs/README.md
  • docs/assets/readme/README.md
  • docs/assets/readme/polylogue-products.tape
  • docs/assets/readme/polylogue-query.tape
  • docs/assets/readme/polylogue-quickstart.tape
  • docs/assets/readme/polylogue-verification.tape
  • docs/assets/readme/readme-demo.sh
  • docs/assets/readme/render-readme-media.sh
  • docs/assets/readme/seed-demo-env.sh
  • docs/browser-capture.md
  • docs/devtools.md
  • docs/internals.md
  • pyproject.toml
  • stubs/dateparser/__init__.pyi
  • tests/unit/devtools/test_render_docs_surface.py
💤 Files with no reviewable changes (8)
  • .agent/includes/agent-memory.md
  • .agent/includes/agent-workflow.md
  • .vscode/direnv-python
  • .vscode/settings.json
  • .claude/settings.json
  • stubs/dateparser/init.pyi
  • docs/assets/readme/polylogue-quickstart.tape
  • .local/README.md

Comment thread .gitignore
Comment on lines +23 to +26
/.cache/
/.local/
.claude/
.vscode/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Mixed anchoring is intentional but worth confirming.

/.cache/ and /.local/ are root-anchored while .claude/ and .vscode/ match at any depth. That's reasonable (caches only collect at the repo root, while editor/agent directories may appear in any subtree), but if you want consistent behavior you could anchor all four.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitignore around lines 23 - 26, The .gitignore mixes root-anchored entries
(/.cache/, /.local/) with unanchored patterns (.claude/, .vscode/); to make
behavior consistent anchor the editor/agent entries by changing .claude/ and
.vscode/ to /.claude/ and /.vscode/ so all four patterns are root-anchored, or
explicitly document/keep the current intent if you want caches anchored and
editor dirs matched at any depth.

Comment on lines +29 to +31
Type "bash docs/assets/readme/readme-demo.sh products"
Enter
Sleep 14s

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Sleep 14s likely truncates the products demo.

The products scene in readme-demo.sh runs seed_env (which executes rm -rf + devtools lab-corpus seed --count 8 --output-dir .local/vhs-readme-products), then two run_scene invocations whose holds alone total 10s, the second of which is polylogue --plain run site -o .local/vhs-readme-products/site-preview (a full static site build). Realistic wall time is well over 14s, so VHS will stop recording before the site-preview output is shown and the resulting polylogue-products.gif will be cut off mid-command.

Either bump the hold (e.g. Sleep 40s) to cover seeding + site build + holds, or shorten the products scene in readme-demo.sh (e.g. drop run site and only show the products listing). Compare against the trim offset 8.2 used by render-readme-media.sh to pick a value that leaves enough post-trim content.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/assets/readme/polylogue-products.tape` around lines 29 - 31, The Sleep
14s in the products demo is too short and truncates the site build output;
either increase the sleep to cover seeding + build (e.g., change Sleep 14s to
Sleep 40s) or shorten the scene by removing the heavy step (remove the second
run_scene that calls "polylogue --plain run site -o
.local/vhs-readme-products/site-preview" and only show the products listing).
Ensure the chosen wall time covers seed_env (which runs rm -rf + devtools
lab-corpus seed --count 8 --output-dir .local/vhs-readme-products), both
run_scene holds, and the static site build so polylogue-products.gif isn’t cut
off; align the final sleep with the trim offset used in render-readme-media.sh
(8.2s) so post-trim content remains visible.

Comment thread docs/assets/readme/readme-demo.sh Outdated
Comment on lines +22 to +36
run_scene() {
local note="$1"
local display_command="$2"
local command="${3:-$display_command}"
local hold="${4:-3}"
if [[ "$command" =~ ^[0-9]+$ ]]; then
hold="$command"
command="$display_command"
fi
clear
caption "$note"
printf '$ %s\n' "$display_command"
bash -lc "$command"
sleep "$hold"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

bash -lc re-sources login profile inside the VHS shell.

The tape opens a hermetic shell with bash --noprofile --norc, but run_scene then spawns bash -lc "$command", which re-enables ~/.bash_profile / ~/.profile sourcing. On a contributor regenerating media locally, profile-set aliases or PATH overrides can leak into the captured output. Plain bash -c "$command" keeps the recording reproducible across machines.

🔧 Proposed fix
-  bash -lc "$command"
+  bash -c "$command"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run_scene() {
local note="$1"
local display_command="$2"
local command="${3:-$display_command}"
local hold="${4:-3}"
if [[ "$command" =~ ^[0-9]+$ ]]; then
hold="$command"
command="$display_command"
fi
clear
caption "$note"
printf '$ %s\n' "$display_command"
bash -lc "$command"
sleep "$hold"
}
run_scene() {
local note="$1"
local display_command="$2"
local command="${3:-$display_command}"
local hold="${4:-3}"
if [[ "$command" =~ ^[0-9]+$ ]]; then
hold="$command"
command="$display_command"
fi
clear
caption "$note"
printf '$ %s\n' "$display_command"
bash -c "$command"
sleep "$hold"
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/assets/readme/readme-demo.sh` around lines 22 - 36, In run_scene(), the
helper spawns a login shell via "bash -lc \"$command\"" which re-sources user
login profiles and can leak local aliases/PATH; change the invocation to use
"bash -c \"$command\"" (i.e., replace bash -lc with bash -c) so the hermetic VHS
shell is preserved and the output remains reproducible—keep the existing quoting
and use of display_command/command/hold unchanged.

Comment on lines +4 to +22
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd "$repo_root"

render_gif() {
local name="$1"
local trim="$2"
local input="docs/assets/readme/${name}.gif"
local palette=".local/${name}-palette.png"
local output=".local/${name}-trimmed.gif"

vhs "docs/assets/readme/${name}.tape"
ffmpeg -y -ss "$trim" -i "$input" \
-vf "fps=12,scale=960:-1:flags=lanczos,palettegen=stats_mode=diff" \
"$palette" >/dev/null 2>&1
ffmpeg -y -ss "$trim" -i "$input" -i "$palette" \
-lavfi "fps=12,scale=960:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=3" \
-loop 0 "$output" >/dev/null 2>&1
mv "$output" "$input"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Script will fail on fresh clones: .local/ is gitignored and never created.

render_gif writes .local/${name}-palette.png and .local/${name}-trimmed.gif, but .local/ is now in .gitignore (per this PR) and the script never creates it. With set -e, the first ffmpeg invocation aborts when the directory is missing. Add a mkdir -p before the renders.

🔧 Proposed fix
 repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
 cd "$repo_root"
+mkdir -p .local
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd "$repo_root"
render_gif() {
local name="$1"
local trim="$2"
local input="docs/assets/readme/${name}.gif"
local palette=".local/${name}-palette.png"
local output=".local/${name}-trimmed.gif"
vhs "docs/assets/readme/${name}.tape"
ffmpeg -y -ss "$trim" -i "$input" \
-vf "fps=12,scale=960:-1:flags=lanczos,palettegen=stats_mode=diff" \
"$palette" >/dev/null 2>&1
ffmpeg -y -ss "$trim" -i "$input" -i "$palette" \
-lavfi "fps=12,scale=960:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=3" \
-loop 0 "$output" >/dev/null 2>&1
mv "$output" "$input"
}
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd "$repo_root"
mkdir -p .local
render_gif() {
local name="$1"
local trim="$2"
local input="docs/assets/readme/${name}.gif"
local palette=".local/${name}-palette.png"
local output=".local/${name}-trimmed.gif"
vhs "docs/assets/readme/${name}.tape"
ffmpeg -y -ss "$trim" -i "$input" \
-vf "fps=12,scale=960:-1:flags=lanczos,palettegen=stats_mode=diff" \
"$palette" >/dev/null 2>&1
ffmpeg -y -ss "$trim" -i "$input" -i "$palette" \
-lavfi "fps=12,scale=960:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=3" \
-loop 0 "$output" >/dev/null 2>&1
mv "$output" "$input"
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/assets/readme/render-readme-media.sh` around lines 4 - 22, The script's
render_gif function writes files into the .local directory (variables palette
and output) but never ensures that .local exists, causing ffmpeg to fail on
fresh clones; update the render_gif function (and any caller if present) to
create the directory before writing by invoking mkdir -p .local (or mkdir -p
"$(dirname "$palette")") right after computing local variables (name, trim,
input, palette, output) so palette and output can be created safely.

Comment on lines +7 to +22
render_gif() {
local name="$1"
local trim="$2"
local input="docs/assets/readme/${name}.gif"
local palette=".local/${name}-palette.png"
local output=".local/${name}-trimmed.gif"

vhs "docs/assets/readme/${name}.tape"
ffmpeg -y -ss "$trim" -i "$input" \
-vf "fps=12,scale=960:-1:flags=lanczos,palettegen=stats_mode=diff" \
"$palette" >/dev/null 2>&1
ffmpeg -y -ss "$trim" -i "$input" -i "$palette" \
-lavfi "fps=12,scale=960:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=3" \
-loop 0 "$output" >/dev/null 2>&1
mv "$output" "$input"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Optional: clean up the intermediate palette file.

$palette (.local/${name}-palette.png) is left behind after each render. A rm -f "$palette" (or a trap) at the end of render_gif keeps .local/ tidy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/assets/readme/render-readme-media.sh` around lines 7 - 22, The
render_gif function leaves the intermediate palette file
(.local/${name}-palette.png) behind; update render_gif to remove the palette
variable (palette) after use—e.g., add a cleanup step (rm -f "$palette") or set
a trap inside render_gif to unlink "$palette" on exit/ERR—so the .local/
directory is not cluttered; reference the render_gif function and the palette
variable to locate where to add the cleanup.

Comment thread docs/assets/readme/seed-demo-env.sh Resolved
Comment thread docs/assets/readme/seed-demo-env.sh Outdated
Comment on lines +9 to +14
if [[ "${1:-}" != "--no-seed" ]]; then
demo_root="${1:-.local/vhs-readme-demo}"
count="${2:-8}"
rm -rf "$demo_root"
eval "$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root" --env-only 2>/dev/null | sed -n '/^export /p')"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Ambiguous $1 overload: same positional is checked as a flag and used as a path.

Line 9 inspects $1 for the literal --no-seed, but line 10 also reads $1 as demo_root. The result is that the seeding branch can only ever use the default demo root (or whatever non---no-seed token a caller passed, which is also being treated as a flag). Likewise, callers can't pass --no-seed and also override demo_root or count.

Use a real flag and shift positional args:

🔧 Proposed fix
-if [[ "${1:-}" != "--no-seed" ]]; then
-  demo_root="${1:-.local/vhs-readme-demo}"
-  count="${2:-8}"
-  rm -rf "$demo_root"
-  eval "$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root" --env-only 2>/dev/null | sed -n '/^export /p')"
-fi
+seed=1
+if [[ "${1:-}" == "--no-seed" ]]; then
+  seed=0
+  shift
+fi
+demo_root="${1:-.local/vhs-readme-demo}"
+count="${2:-8}"
+if (( seed )); then
+  rm -rf "$demo_root"
+  eval "$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root" --env-only | sed -n '/^export /p')"
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [[ "${1:-}" != "--no-seed" ]]; then
demo_root="${1:-.local/vhs-readme-demo}"
count="${2:-8}"
rm -rf "$demo_root"
eval "$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root" --env-only 2>/dev/null | sed -n '/^export /p')"
fi
seed=1
if [[ "${1:-}" == "--no-seed" ]]; then
seed=0
shift
fi
demo_root="${1:-.local/vhs-readme-demo}"
count="${2:-8}"
if (( seed )); then
rm -rf "$demo_root"
eval "$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root" --env-only | sed -n '/^export /p')"
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/assets/readme/seed-demo-env.sh` around lines 9 - 14, The script
ambiguously uses $1 both as a flag and as the demo_root; modify the argument
parsing to handle a real flag (e.g., --no-seed) first using a
while/getopts-style loop or case loop that consumes flags with shift, set a
boolean like no_seed, then after flags are shifted assign
demo_root="${1:-.local/vhs-readme-demo}" and count="${2:-8}"; update the
conditional that runs devtools lab-corpus seed to check the no_seed flag (not
the raw $1) and keep the existing eval "$(devtools lab-corpus seed ...)"
invocation unchanged so callers can pass --no-seed and still override
demo_root/count correctly.

Comment thread docs/assets/readme/seed-demo-env.sh Outdated
demo_root="${1:-.local/vhs-readme-demo}"
count="${2:-8}"
rm -rf "$demo_root"
eval "$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root" --env-only 2>/dev/null | sed -n '/^export /p')"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Don't silently discard devtools lab-corpus seed stderr.

Redirecting 2>/dev/null and then piping to sed masks any failure from the seed command. With set -euo pipefail, if devtools exits non-zero the script will still abort, but the user sees no diagnostic and the eval block produces an empty string — turning a useful error into a confusing silent miss when the seed step fails (e.g., devtools missing, corpus error). Consider keeping stderr visible (or routing it to a log file) so failures are debuggable.

-  eval "$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root" --env-only 2>/dev/null | sed -n '/^export /p')"
+  eval "$(devtools lab-corpus seed --count "$count" --output-dir "$demo_root" --env-only | sed -n '/^export /p')"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/assets/readme/seed-demo-env.sh` at line 13, The command pipeline that
runs devtools lab-corpus seed (the eval "$(devtools lab-corpus seed --count
"$count" --output-dir "$demo_root" --env-only 2>/dev/null | sed -n '/^export
/p')") is currently discarding stderr, which hides failures; update the pipeline
so stderr from devtools lab-corpus seed is not redirected to /dev/null (either
remove "2>/dev/null" or redirect stderr to a logfile and surface it), preserving
the sed filtering of export lines so that failures from devtools are visible and
debuggable while still producing the expected env exports.

@Sinity

Sinity commented Apr 26, 2026

Copy link
Copy Markdown
Owner Author

Scope cleanup after structural audit: removed the parallel README/VHS media rebuild from this PR and updated the body accordingly. The branch now keeps to repo-root cleanup, browser-extension flattening, docs-map generation, and dateparser typing cleanup. README media/scenario-backed demos stay tracked under #410/#412.

@Sinity
Sinity merged commit 6beff2a into master Apr 26, 2026
14 checks passed
@Sinity
Sinity deleted the feature/chore/repo-root-layout branch April 26, 2026 01:11
@Sinity

Sinity commented Apr 28, 2026

Copy link
Copy Markdown
Owner Author

🤖 Post-hoc audit note: this PR received bot review feedback verified against current HEAD as part of #544. 1 finding(s) confirmed still present → tracked in #550.

@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Sinity
Sinity requested a review from Copilot May 1, 2026 00:44

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sinity added a commit that referenced this pull request May 7, 2026
Summary:
Clean the repository root and documentation map without changing the README media system. This removes tracked local/editor/cache state, flattens the browser extension directory, replaces the local dateparser stub with the published stub dependency, and keeps generated docs surfaces focused on durable reader paths.

Problem:
The repository root mixed source artifacts with local working-state sentinels and editor/agent settings. The browser extension lived under a redundant nested directory, docs still advertised tracked `.cache`/`.local` README files, and `mypy_path = "stubs"` existed only to support a tiny dateparser stub.

Solution:
Remove tracked local-state dotdirs, ignore those roots directly, flatten `browser-extension/`, add `types-dateparser`, remove the local stub package, and update docs-surface rendering/tests. README/VHS/media redesign remains tracked separately in #410 and #412.

Verification:
- `pytest -q tests/unit/devtools/test_render_docs_surface.py` -> 2 passed.
- `devtools render-all --check` -> sync OK.
- Push hook `devtools verify --quick` -> all checks passed.
- GitHub lint/typecheck/nix/showcase/CodeQL/GitGuardian/CodeRabbit checks passed; Python matrix jobs remained pending under the known CI quota/running constraint.

Ref #403
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.

2 participants