Skip to content

feat: keep source reconciliation inputs trustworthy - #238

Merged
yordis merged 2 commits into
mainfrom
yordis/feat-source-bundle-validation
Oct 23, 2026
Merged

yordis merged 2 commits into
mainfrom
yordis/feat-source-bundle-validation

Conversation

@yordis

@yordis yordis commented Oct 23, 2026

Copy link
Copy Markdown
Member
  • Source reconciliation needs stable input identity before native mappings or durable runs can be trusted.
  • Supplied bytes must remain inert, bounded and traceable without implying native validity or external completeness.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
New isolated core module with no server wiring; intake validation and digest logic are well-tested but will underpin future source identity if mis-specified.

Overview
Adds the supplied-native-v1 intake boundary in trogon-atlas-core via source_bundle::validate_bundle, which validates strict inventory JSON and named files under documented size/count limits, retains original bytes without I/O or native compilation, and returns inventory, bundle, and per-file SHA-256 digests with sanitized BundleError categories.

Documentation now treats this profile as implemented (new source-bundle-profile.md, updated source integration contracts/acceptance and architecture roadmap) while registration, overlays, reconciliation runs, and persistence remain proposed.

Boundary and vector tests lock digest framing, partition/locator rules, duplicate-key rejection, JSON-depth limits, and error hygiene. Adds serde to core and bumps ctutils in lockfiles.

Reviewed by Cursor Bugbot for commit 44a73f8. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6e096349-420d-4f52-a2ff-08ee512a1fbe
📥 Commits

Reviewing files that changed from the base of the PR and between 547c3ea and 44a73f8.

⛔ Files ignored due to path filters: 2
  • rsworkspace/Cargo.lock is excluded by !**/*.lock
  • rsworkspace/crates/trogon-atlas-server/fuzz/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 10
  • docs/README.md
  • docs/explanation/architecture-resource-roadmap.md
  • docs/reference/source-bundle-profile.md
  • docs/reference/source-integration-acceptance.md
  • docs/reference/source-integration-contracts.md
  • rsworkspace/crates/trogon-atlas-core/Cargo.toml
  • rsworkspace/crates/trogon-atlas-core/src/lib.rs
  • rsworkspace/crates/trogon-atlas-core/src/source_bundle.rs
  • rsworkspace/crates/trogon-atlas-core/tests/source_bundle.rs
  • rsworkspace/crates/trogon-atlas-core/tests/source_bundle_vectors.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The change adds a Rust source_bundle intake validator. It validates supplied inventory JSON and files, retains validated bytes, and computes deterministic inventory, bundle, and file-content digests. Documentation and tests describe and verify the implemented intake boundary.

Changes

Source Bundle Intake

Layer / File(s) Summary
Intake profile and status
docs/reference/source-bundle-profile.md, docs/reference/source-integration-contracts.md, docs/explanation/architecture-resource-roadmap.md, docs/reference/source-integration-acceptance.md, docs/README.md
The reference defines the supplied bundle profile. The contract, roadmap, acceptance document, and README identify the implemented intake boundary and distinguish it from pending source integration work.
Rust bundle validation
rsworkspace/crates/trogon-atlas-core/Cargo.toml, rsworkspace/crates/trogon-atlas-core/src/lib.rs, rsworkspace/crates/trogon-atlas-core/src/source_bundle.rs
The core crate exposes source_bundle. validate_bundle checks bounded inventory JSON and supplied files, then returns retained validated data with inventory, bundle, and file-content digests or categorized errors.
Validation and digest tests
rsworkspace/crates/trogon-atlas-core/tests/source_bundle.rs, rsworkspace/crates/trogon-atlas-core/tests/source_bundle_vectors.rs
Tests cover accepted data, validation failures, limits, byte retention, digest sensitivity, and fixed digest vectors. They also verify that file transport order does not change the bundle digest.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Possibly related PRs

  • TrogonStack/atlas#237: PR #237 defines the proposed source integration contract that this change implements at the supplied-bundle intake boundary.
Merge Risk: ⚪ Minimal · up to 44a73

This change adds an intake validator for supplied source bundles, along with documentation and tests. No concrete merge-blocking risk was found in review.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 60 functions across 4 files. (6 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "feat: keep source reconciliation inputs trustworthy" matches the main change. The PR adds the source_bundle intake in trogon-atlas-core. That intake validates supplied inventory JSON and fi…
Description check Passed The description states that source reconciliation needs stable input identity before native mappings or durable runs can be trusted. It also states that supplied bytes must remain inert, bounded, and …
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.
Full details: Title check

Explanation

The title "feat: keep source reconciliation inputs trustworthy" matches the main change. The PR adds the source_bundle intake in trogon-atlas-core. That intake validates supplied inventory JSON and files, checks limits and digests, and returns typed errors. The PR description and objectives describe the same goal of stable, bounded, traceable input identity. The title is short, specific, and in conventional-commit form. It names a goal rather than the mechanism, which is acceptable.

Full details: Description check

Explanation

The description states that source reconciliation needs stable input identity before native mappings or durable runs can be trusted. It also states that supplied bytes must remain inert, bounded, and traceable. These points match the changeset. The changeset adds strict intake validation, byte and count limits, SHA-256 digests, and docs that limit the scope to intake only.

Full details: Docstring Coverage

Explanation

Docstring coverage is 28.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 60 functions across 4 files. (6 skipped: 6 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

I’m a rabbit with a bundle to inspect,
I check each byte and field in turn.
The names stay sorted, digests line up,
And strict limits mark each boundary.
The tests confirm what I can keep,
Then off I hop, with source bytes intact.

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

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis merged commit 1fd23f1 into main Oct 23, 2026
27 checks passed
@yordis
yordis deleted the yordis/feat-source-bundle-validation branch October 23, 2026 10:13
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.

1 participant