Skip to content

fix: parse local registries with real TOML (closes #413)#461

Open
0xLeif wants to merge 3 commits into
mainfrom
fix/413-registry-real-toml
Open

fix: parse local registries with real TOML (closes #413)#461
0xLeif wants to merge 3 commits into
mainfrom
fix/413-registry-real-toml

Conversation

@0xLeif

@0xLeif 0xLeif commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Problem

Local registry handling (src/registry.rs) used a line scanner instead of a real TOML parser:

  1. The documented array-of-tables modules format was silently misparsed — only mappings under the specs table were collected, so a registry written in the documented shape parsed as name = last module's name with zero mappings; every mapping was silently dropped.
  2. Malformed TOML with a surviving name= line (e.g. name = {{{) was silently accepted, violating the fail-closed contract.

Fix

  • Replaced the line scanner with real TOML parsing (added toml crate dependency).
  • Both the specs-table shape and the documented array-of-tables modules shape are supported; malformed module entries are rejected.
  • Malformed TOML now hits the established failed to parse local registry … error; is_inert_legacy_registry_stub no longer treats garbage as inert.

Regression tests

  • parse_registry_supports_documented_modules_shape
  • load_local_registry_fails_closed_on_malformed_toml_with_name_line
  • modules_entry_missing_spec_key_is_an_error
  • Previously failing canonical_resolution_tolerates_inert_legacy_registry_stub and both semantic_application_*registry* tests now pass.
  • Drill reference: CorvidLabs/spec-sync-sandbox drills/012-registry-parser-realities.sh

Validation

cargo test + cargo clippy -- -D warnings green (only pre-existing root-only failure change::tests::non_git_walk_skips_volatile_trees_but_fails_on_relevant_walk_errors).

Closes #413

@0xLeif
0xLeif requested a review from a team as a code owner July 24, 2026 19:56
@0xLeif
0xLeif requested review from 0xGaspar, Kyntrin and tofu-ux July 24, 2026 19:56
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions 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.

❌ Corvin says...

      _
    <(;\  .oO(oh no...)
     |/(\
      \(\\
      " "\\

"I'm pecking through the errors..."

CI Summary

Check Status
Validate action.yml ✅ Passed
Packaged Action Consumer ✅ Passed
Dependency Audit ✅ Passed
Code Coverage ✅ Passed
Format Check ❌ failure
Docs Site ✅ Passed
Spec Validation ❌ failure
Tests (build, test, clippy) ✅ Passed
VS Code Extension ✅ Passed
📋 Spec Validation Details

❌ SpecSync: Failed

Metric Value
Specs checked 62
Passed 62
Errors 1
Warnings 0
File coverage 100% (105/105)
LOC coverage 100% (86967/86967)

Errors

.specsync/sdd.json

  • meaningful changed paths are not covered by an active change: Cargo.lock, Cargo.toml, src/registry.rs

Action Items

  • Review and fix -- meaningful changed paths are not covered by an active change: Cargo.lock, Cargo.toml, src/registry.rs

Generated by specsync · Run specsync check --format github to reproduce


Powered by corvid-pet

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.

Local registry parser silently misparses documented [[modules]] format and accepts malformed TOML

1 participant