Skip to content

fix(reference): preserve observed entry failure reasons - #770

Closed
rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-reference-entry-failure-reasons-20261006
Closed

rudycelekli wants to merge 1 commit into
morluto:mainfrom
rudycelekli:fix/rea-reference-entry-failure-reasons-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown

Summary

Preserve observed per-entry filesystem/type failure reasons in reference-source imports. Self-contained bug fix; no separate issue linked.

Problem and expected behavior

An owned unreadable source file produces an EACCES diagnostic with the affected path in the filesystem reader. Import projection discarded it and returned generic permission advice. A FIFO's actual Entry is not a regular file reason was also discarded and replaced with advice to use a supported system. Callers need the observed constraint to decide how to repair or exclude an entry.

Change and scope

Retain the reader's message alongside recovery guidance. Unsupported entry guidance now says to exclude it or replace it with a regular file. Caller-selected local diagnostic paths are intentionally preserved under REA's local evidence rule. Top-level parser/policy error projection and transport credential handling are unchanged.

Contract and boundary impact

  • Semantic owner and earliest changed stage: reader failure to graph-entry limitation projection.
  • CLI and MCP/tool-catalog contract: schemas unchanged; per-entry limitation text preserves the observed reason.
  • Provider, bridge, target-format, or platform compatibility: local source filesystem only.
  • Evidence, artifact, provenance, or reconstruction contract: retains OS code/path and unsupported type constraint; readable entries unchanged.
  • Process execution, authorization, cleanup, or containment impact: none; no-follow reading and caller exclusions unchanged.
  • Generated metadata (docs/product-catalog.json), package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: actual chmod000 file and mkfifo entry; readable control; projection expectation follows the current local diagnostic preservation rule.
  • Base reproduction or other evidence: two native failures and one passing readable control on base8238232. Executed reader→public import→built CLI before/after. Before, CLI limitations omit EACCES/type details; after, they contain the actual reader diagnostic and affected owned path. Unsupported FIFO guidance no longer suggests another OS.
  • User-visible CLI/MCP output: e.g. File could not be read: EACCES ... open '<selected path>' remains in the graph entry's limitations alongside guidance.
  • Remaining proof gaps: actual POSIX proof on macOS arm64; permission cases skip Windows/root UID. No claim of broader error sanitization changes or unrelated binary providers.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • Native built CLI import-reference-source before/after — discarded reasons on base, preserves them after; readable control unchanged.
  • npm run test:focused -- tests/boundary/filesystem/referenceSourceFailureDetails.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts tests/boundary/filesystem/referenceSourceReader.test.ts — 23 passed.
  • npm run check — 5 tasks successful; 125 existing warnings, zero errors.
  • npm run check:fast — 2 tasks successful.
  • git diff --check — passed; SSH signature and DCO verified. Reused exact Node24.18.0/Vitest5.0.3/TypeScript7.0.2; no dependency edits.

Hosted full coverage tracked separately. External provider verification is not applicable to this filesystem projection.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS native filesystem only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: preserves caller-selected local paths and meaningful diagnostics, without changing transport credentials or explicit secret exclusions. Only owned temporary fixtures; permissions restored before cleanup.

AI assistance: implemented and source reviewed with Codex on behalf of @rudycelekli before publication.

Review checklist

  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Reviewed: preserving observed entry failure reasons (${entry.message} + guidance) matches local-evidence rules — caller-selected paths and OS codes (EACCES, not-regular-file) are preserved, not redacted. Unsupported-entry guidance fix (exclude/replace vs use supported system) is correct. Real chmod-000/FIFO boundary tests + projection update cover it. APPROVE. Minor polish: watch double-punctuation when message already ends with '.'.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Review — APPROVE

Summary

Changes projectReferenceSourceEntryFailure in ReferenceSourceImportEntries.ts from redacted generic guidance to ${entry.message} + guidance, and fixes unsupported-entry guidance from "use a supported system" to "exclude or replace with regular file".

Verification

  • Matches the local-evidence rule: caller-selected root paths and OS codes (EACCES, Entry is not a regular file) are preserved, not guessed as secret.
  • Failure reasons propagate through the application layer; no schema/catalog change needed (free-form limitations: string[]).
  • New tests/boundary/filesystem/referenceSourceFailureDetails.test.ts (real chmod 000 EACCES, real mkfifo FIFO, readable control) plus updated projection test asserting inclusion. Covers directory / file / symlink io, cancelled, unsupported.
  • CI: all SUCCESS.

Polish (non-blocking)

  • src/application/ReferenceSourceImportEntries.ts:23-25: ${entry.message} ${guidance} can double-punctuate if message already ends with .. Consider normalizing the separator.

@rudycelekli

Copy link
Copy Markdown
Author

Checked the formatter: it currently joins the literal reader message and recovery guidance with a single space (${entry.message} ${entryRecoveryGuidance(entry)}), without adding a period. A reader message that already ends in . therefore keeps that literal punctuation followed by the guidance; this formatter does not introduce a second period. I retained the exact observed message and made no additional source change. Checked with Codex assistance on behalf of @rudycelekli.

@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Superseded by #815, which integrated this change and has now merged (3af3811). Thanks @rudycelekli for the fix and the thorough verification — much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants