Skip to content

fix: bug portable SDD catalog generation follows symlinks outside the repository (#771) - #783

Merged
efraespada merged 2 commits into
developfrom
bugfix/771-bug-portable-sdd-catalog-generation-follows-symlinks-outside-the-repository
Oct 29, 2026
Merged

efraespada merged 2 commits into
developfrom
bugfix/771-bug-portable-sdd-catalog-generation-follows-symlinks-outside-the-repository

Conversation

@efraespada

@efraespada efraespada commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Closes #771.

A valid catalog could make --write follow a specs/CATALOG.md symlink and overwrite its external target while reporting success. Catalog access now pins real directories, validates destination/file identities, writes through an exclusive owned temporary file, and publishes by atomic replacement or no-replace creation. Parent/leaf substitutions cannot redirect the write. Concurrent new files, external hard-link aliases and foreign temporary replacements are preserved. Read-only validation checks the opened file before consuming data; unsafe or stale access exits nonzero without a success receipt.

Adds 40 filesystem/CLI regressions, including boundary races, I/O faults, working-directory restoration and an isolated portable dependency-copy test. Cleanup retries a failed initial descriptor stat once; if identity or removal remains unavailable it reports the generated temporary basename and ownership-inspection guidance, preserving unverified entries. The initial 19-case baseline had 14 failures; all three descriptor-stat regression cases also fail against the first implementation. Updates the SDD, catalog, development guide and generated bundles. The new helper has explicit mandatory 95% lines/statements and 90% branches/functions budgets; existing budgets and Codecov thresholds remain unchanged.

Validation on the review correction: all 40 cases pass with 98.79% lines, 97.19% statements, 100% functions and 91.01% branches. Typecheck, lint, specifications, documentation, build consistency, npm package validation and package smoke pass. Mandatory commit hooks pass with the normal concurrency: build, all 774 suites / 14,259 passed tests (35 existing skips), and lint. Exact-head CI, platform smoke and independent re-review must complete before merge. The initial-head full coverage run also passed all global/module budgets and setup acceptance; its figures are not a coverage claim for this correction. No consumer repository was modified or executed.

CI on 8424d1af: all 774 suites / 14,259 passed tests, global coverage 98.03% lines, 97.24% statements, 97.93% functions and 94.88% branches; coverage budgets and setup acceptance pass. Codecov has processed this exact commit (94.79% project coverage). Independent review is complete with zero active findings; the prior cleanup finding is verified fixed and its thread resolved. Native V8 covers 12 uninstrumented exact-source recordings of the 40-case suite, including actual CLI children; remaining raw gaps are disclosed OS-constant fallbacks and a defensive nonregular-descriptor guard, with no ignore annotations.

…de-the-repository: prevent catalog publication through unsafe destinations (#771)
@docs-page

docs-page Bot commented Oct 29, 2026

Copy link
Copy Markdown

To preview the documentation for this pull request, visit the following URL:

docs.page/vypdev/copilot~783

Documentation is deployed and generated using docs.page

@vypbot vypbot added size: XXL Indicates an extremely large task or issue that requires significant time and effort to complete. state:ai-processing labels Oct 29, 2026
@vypbot vypbot changed the title Prevent portable catalog generation from following destination links fix: bug portable SDD catalog generation follows symlinks outside the repository (#771) Oct 29, 2026
@vypbot
vypbot self-requested a review October 29, 2026 10:04
@vypbot vypbot added this to vypdev Oct 29, 2026
@vypbot vypbot moved this to In Progress in vypdev Oct 29, 2026
@vypbot
vypbot changed the base branch from develop to master October 29, 2026 10:04
@vypbot vypbot added the 85% Progress: 85% label Oct 29, 2026
@vypbot
vypbot changed the base branch from master to develop October 29, 2026 10:05

@vypbot vypbot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current status: All findings originating in this review are resolved.
Last reconciled on 8424d1a. See aggregate Bugbot status.

🤖 Bugbot review snapshot

Bugbot reported 1 potential problem when commit 2252127 was analyzed. This snapshot is historical; use the status block above for current state. 1 finding is linked to changed code.

Findings

  • low: A failed temporary-file stat leaves an orphan behind — src/infrastructure/specification_catalog_publication.cjs:79

@vypbot

vypbot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Bugbot: review complete

Current status: No active findings on 8424d1a.

Pull request · Verified commit · Workflow run

@vypbot

vypbot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Copilot approval · Human review needed

Status: A protected workflow, policy, or trust-boundary file changed.
Completed: 1/1 observed checks succeeded; Bugbot complete.
Action required: Ask a human reviewer to decide.
Impact: No new approval is confirmed for this revision.
See checks

Technical evidence

Revision: 8424d1af1622; base: a0ddd1ef8a4e; reason: protected-path.

@codecov-commenter

codecov-commenter commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.86047% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.79%. Comparing base (5b3664f) to head (8424d1a).
⚠️ Report is 59 commits behind head on develop.

Files with missing lines Patch % Lines
...frastructure/specification_catalog_publication.cjs 91.86% 1 Missing and 6 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #783      +/-   ##
===========================================
+ Coverage    94.50%   94.79%   +0.29%     
===========================================
  Files         1035     1079      +44     
  Lines        33299    34951    +1652     
  Branches      9824    10383     +559     
===========================================
+ Hits         31468    33133    +1665     
+ Misses         699      683      -16     
- Partials      1132     1135       +3     
Files with missing lines Coverage Δ
...frastructure/specification_catalog_publication.cjs 91.86% <91.86%> (ø)

... and 55 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…de-the-repository: recover or disclose temporary cleanup failures
@efraespada
efraespada merged commit 5188b93 into develop Oct 29, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

80% Progress: 80% size: XXL Indicates an extremely large task or issue that requires significant time and effort to complete. state:verified

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛🧑‍💻 - bug portable SDD catalog generation follows symlinks outside the repository

3 participants