Skip to content

fix: render scalar catalog titles and canonicalize rg inbound paths (#72) (#73) - #74

Merged
RichardHightower merged 2 commits into
mainfrom
fix/scalar-title-and-rg-paths
Aug 31, 2026
Merged

fix: render scalar catalog titles and canonicalize rg inbound paths (#72) (#73)#74
RichardHightower merged 2 commits into
mainfrom
fix/scalar-title-and-rg-paths

Conversation

@RichardHightower

Copy link
Copy Markdown
Contributor

Fixes #72. Fixes #73.

Both are the PKC instances of the two defects fixed in system-architecture-capture v0.5.4.

#72 — scalar catalog titles

_escape_link_label() assumed a string, so a concept with title: 421 aborted catalog rendering with AttributeError. Capture and ingest write concepts before refreshing indexes, so the failure left a partially updated bundle.

PKC has two renderers. refresh_catalog_index() and ensure_catalog_index() both built the label, so patching only the first would leave first-time catalog creation broken. Both now call one _catalog_label() helper, which also fixes the quieter half of the bug: title or p.stem sent a falsy-but-real title (0, false) to the file stem.

#73 — rg inbound paths

rg_list_files() resolves the paths it returns. _inbound_via_rg() derived src with path.relative_to(bundle), which raises when the bundle is addressed through a symlink alias. The handler silently continued, dropping a real inbound edge, while the pack still reported reverse_index: rg.

resolve_knowledge_root() returns an absolute --bundle verbatim, so this was reachable from the CLI:

--rg     reverse_index=rg   nodes=['/features/root.md']
--no-rg  reverse_index=scan nodes=['/features/caller.md', '/features/root.md']

is_concept_path() in the same loop already resolved both operands, so the boundary was inconsistent within one body.

Verification

100 tests pass. Both new tests are red when the two script files are stashed:

ERROR: test_yaml_scalar_titles_render_as_text (renderer='refresh_catalog_index')
ERROR: test_yaml_scalar_titles_render_as_text (renderer='ensure_catalog_index')
FAIL:  test_inbound_pack_survives_a_symlink_aliased_bundle

🤖 Generated with Claude Code

https://claude.ai/code/session_01TZ1sCoZonCJw2oPbPcPioW

RichardHightower and others added 2 commits August 31, 2026 13:43
) (#73)

Two defects the SAC v0.5.4 fixes exposed in the shared renderer and the
shared rg accelerator.

#72: `_escape_link_label()` assumed a string, so a concept with `title: 421`
aborted catalog rendering after capture had already written concepts. It now
normalizes to text at the boundary. `fm_c.get("title") or p.stem` also sent a
falsy-but-real title (`0`, `false`) to the file stem. Both renderers now share
one `_catalog_label()` helper, so the fallback rule cannot drift between them.
PKC has two renderers, so patching only `refresh_catalog_index` would leave
first-time catalog creation broken.

#73: `rg_list_files()` resolves its hits, but `_inbound_via_rg()` derived `src`
with `path.relative_to(bundle)`. A bundle reached through a symlink alias made
that raise, and the handler silently dropped a real inbound edge while the pack
still reported `reverse_index: rg`. `resolve_knowledge_root()` returns an
absolute `--bundle` verbatim, so this was reachable from the CLI.

Both regression tests are red without the corresponding fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZ1sCoZonCJw2oPbPcPioW
mkdtemp yields the /var alias on macOS but a plain /tmp path on Linux, so the
regression assertion was inert on CI — the platform it most needs to cover.
Create the symlink explicitly and address the bundle through it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZ1sCoZonCJw2oPbPcPioW
@RichardHightower
RichardHightower merged commit ab059ab into main Aug 31, 2026
4 checks passed
@RichardHightower
RichardHightower deleted the fix/scalar-title-and-rg-paths branch August 31, 2026 18:46
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.

rg-backed inbound pack drops matches when the bundle path uses a symlink alias Catalog rendering crashes when a concept title is a YAML integer

1 participant