Skip to content

fix(console): use lossless catalog file identities - #244

Merged
mohanagy merged 1 commit into
developmentfrom
fix/242-bigint-file-identity
Jul 25, 2026
Merged

fix(console): use lossless catalog file identities#244
mohanagy merged 1 commit into
developmentfrom
fix/242-bigint-file-identity

Conversation

@mohanagy

@mohanagy mohanagy commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Closes #242.

Root cause: Windows Node Number dev/ino values can collapse distinct files. The Console catalog used that lossy representation for its verified-entry checks and dedupe set, omitting a valid configuration.

This repair uses BigInt file identities for canonical-directory checks, opened-handle and after-read checks, and catalog deduplication. The normal Stats snapshot remains only for the existing migration-source fingerprint. No ACL, no-follow, bounded-read, or audit guarantee is removed.

TDD: a deterministic regression proves two adjacent BigInt file IDs have equal Number projections but remain distinct under the catalog identity helper. The Windows regression now accepts both Number diagnostic outcomes while requiring BigInt non-duplication and both trusted configurations.

Local validation: focused Console dashboard test, OAuth and Console suite, lint, typecheck, and diff check passed.

Summary by CodeRabbit

  • Bug Fixes
    • Improved console configuration discovery security checks for files and directories.
    • Prevented distinct files from being incorrectly treated as duplicates on systems with large filesystem identity values.
    • Improved validation of file ownership, permissions, paths, and size constraints.
    • Updated discovery diagnostics to report duplicate and validation results more accurately.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Console configuration discovery now uses BigInt filesystem identities for trusted path validation, opened-file checks, post-read checks, and deduplication. Tests cover precision-collision identities and Windows-specific diagnostic output.

Changes

Configuration identity validation

Layer / File(s) Summary
BigInt trust helpers
src/console/console-config-catalog.ts, tests/console-dashboard-application-service.test.ts
Adds BigInt-compatible identity and trust checks, including the exported sameBigIntFileIdentity helper and its precision-collision test.
Trusted file validation
src/console/console-config-catalog.ts
Validates opened and post-read files with BigInt statistics, size checks, and exact-width identity payloads.
Candidate deduplication diagnostics
src/console/console-config-catalog.ts, tests/console-dashboard-application-service.test.ts
Uses exact identities for duplicate detection, tracks numeric collisions separately, and updates Windows assertions for candidate identity diagnostics.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • mohanagy/miftah#206: Modifies Console standard/trusted configuration discovery and dashboard selection behavior.
  • mohanagy/miftah#223: Overlaps with trusted configuration reading and per-candidate discovery diagnostics.

Poem

A rabbit checks each inode bright,
With BigInt ears for extra sight.
No duplicate slips through the gate,
Exact-width paws decide its fate.
Windows tests now thump with cheer!


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 15.38% 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 is concise and accurately summarizes the core fix: using lossless file identities for console catalog discovery.
Description check ✅ Passed The description covers the root cause, fix, security impact, and validation results, matching the template's intent.
Linked Issues check ✅ Passed The change adds a deterministic regression and fixes Windows catalog dedupe with BigInt identities while preserving security rules.
Out of Scope Changes check ✅ Passed The modified files stay focused on console catalog identity handling and targeted test updates, with no clear unrelated changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/242-bigint-file-identity

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

@mohanagy
mohanagy merged commit 6250893 into development Jul 25, 2026
21 of 23 checks passed
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.

test: stabilize Console configuration catalog dedupe under Windows Node 24

1 participant