Skip to content

feat: Phase 2 portfolio tracks P2, P4-P8 with shared local-path guard (R4-F1 fixed via #147; Opus+Sol approved f40a18d) - #140

Merged
DVOpenLabs merged 21 commits into
mainfrom
feat/portfolio-integration
Nov 14, 2026
Merged

DVOpenLabs merged 21 commits into
mainfrom
feat/portfolio-integration

Conversation

@DVOpenLabs

@DVOpenLabs DVOpenLabs commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Draft for review. Opus APPROVE-WITH-NOTES (rounds 5 and 6); Sol BLOCK on the documented passport export output-directory race (rounds 5 and 6). Maintainer authorized this draft PR with the finding open. Merge and release are not authorized.

What this is

Phase 2 portfolio tracks P2, P4, P5, P6, P7 and P8 plus the shared local-path guard and cross-track tests, on one branch. Base is integ/phase2 at 5d4a27b (the head of #138). #138 and #139 are untouched. It is one PR because test_review_fixes*.py imports several tracks at once; commits are ordered (guard, then one commit per track, then cross-track tests, then one test-literal fix) and only the head is claimed green. Intermediate commits were not run individually.

Unresolved blocking finding (Sol, round 5, still open)

backend/snapstudio_core/passport_cli.py:143, R4-F1, severity HIGH, BLOCK:

The output-directory TOCTOU remains. After the guard at line 133, an actor able to replace the directory or an ancestor can redirect mkstemp and the subsequent write to a network share. The new documentation accurately acknowledges this prerequisite and consequence, but does not change the operation.

Sol's suggested fix: platform-appropriate directory-handle operations that stop path substitution redirecting creation, publication and cleanup. Rechecking the pathname alone would narrow the window, not close it.

Opus rates the same point LOW (same-user, CLI only, the HTTP routes write no passport, final publish never overwrites, the written data is file names and hashes). Fable and Astra both advised accepting the documented limit for development PRs. The maintainer chose to document it (Option A) and to open this draft with the finding open. This is risk acceptance for a draft, not a fix. The limit is stated in passport_cli.py (module docstring), localpath.py and docs/internal/PASSPORT.md ("Path checks are not a sandbox"). Not implemented: Fable's optional post-mkstemp re-check (_reaches_network(tmp) plus st_dev comparison); its Windows volume-id behaviour is unverified.

Remaining review notes (all carried, none fixed here)

Opus, round 5: O5-1 drive-letter check is not strictly ASCII (localpath.py:37); O5-2 no test for a folder or trailing-separator -o (bad_output); O5-5 names containing : or a separator need an explicit --path; O5-6 on Windows -o input.3mf:stream is unverified (pre-existing). Addressed in 0c1a8c6 (docs/docstrings only, reviewed in round 6): O5-3, O5-4 and Sol R5-F2. Round 6 (Opus APPROVE-WITH-NOTES; Sol BLOCK = R4-F1 only, delta clean) adds optional notes: O6-1 localpath.py:81,102 docstrings still sound absolute about leaving the machine; O6-2 CREATIVE_COMPAT.md:36 and the CLI message Studio reads local files only. (passport_cli.py:47; test_review_fixes_r2.py:78 asserts that substring) are not yet aligned; O6-3 two reflowed lines are long. Earlier Opus LOW notes: no per-request hashing budget (O2-5), an invalid gradient row is still emitted as a recipe (O2-7), tool-numbering and copy polish (O2-9).

Known accepted limits: mapped drive letters and mounted network filesystems look local; a file growing during hashing is not interrupted; real Windows symlink/junction behaviour is untested (simulated-link tests cover the walk).

Verified environments and limits

  • Windows, Python 3.13, full backend: 5232 passed, 51 skipped, on the reviewed bytes (before the test-literal commit).
  • Linux, real git clone at 5d4a27b with the 141 files overlaid, Python 3.12 (WSL), not CI's 3.13: 5233 passed, 50 skipped. An earlier Linux run (5208 passed, 52 skipped, 2 failed) was not green; the two failures came from a copy without .git and pass in a real checkout. Counts differ from Windows only through platform skips.
  • Desktop (tsc clean, vitest 1470) was last run before this branch; no desktop source changed after that.
  • Committed blobs vs the frozen5 manifest (fc8f697e27da…, 141 files): byte-identical, no line-ending normalisation applied. One later commit changes one test literal in tests/passport/test_passport_chain.py (/home/... to /mnt/vault/...) to satisfy check-source-independence, which now reports 0 violations; the 20 tests in that file pass. That commit and the wording commit 0c1a8c6 were reviewed in round 6 (Opus APPROVE-WITH-NOTES; Sol BLOCK only on R4-F1, no new delta finding). CI on 0c1a8c6 is checked separately.
  • Limits: everything is fixture-tested or mock-service-tested. No hardware, no Orca runs, no slicing, no round-trip saving, no physical accessory or print results. Sol's and Opus's reviews were read-only (no tests run by them). Real third-party clients were not exercised.

Portfolio inventory (from the plan and the code)

Product tracks P1 to P8; foundations and this integration are supporting work. Entry points are in the desktop Studio+ navigation group (Advanced mode) unless noted.

Track Status Entry point Evidence
P1 accessory adapters, Setups in open PRs #131-#133, not re-verified here Setups view not part of this PR
P2 creative tools partial: container inspection works; DitherForge, Kromacut, SindriCAD have no reader; ImageMap and Lumina need an explicit format choice Creative route; POST /creative/inspect fixtures, screenshot
P3 Lumina adapter in open PR #139, "experimental, not wired" none not part of this PR
P4 calibration functional Calibration route tests, screenshot
P5 assemblies functional Assemblies route tests, screenshot
P6 variants functional Variants route tests, screenshot
P7 passport functional Passport route; u1convert passport export/import/verify tests, real CLI entry point, screenshot
P8 recovery and monitoring partial: checkpoint/restore and monitoring context work; cross-track end-to-end coverage (test 11) not written; the monitoring panel uses fixed port 7125 Recovery route tests, screenshot

The portfolio is not complete: the creative readers and P8 cross-track coverage remain gaps.

🤖 Generated with Claude Code

DVOpenLabs and others added 9 commits November 1, 2026 07:18
Refuses UNC/device paths in any slash style, links to them and oversize files before a track opens a user-supplied path. Best-effort, not a sandbox: validation and use are separate steps (documented in the module).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reads 3MF-family containers from creative tools and reports what Studio can and cannot verify. Fixture-tested; DitherForge, Kromacut and SindriCAD have no reader yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Imports calibration results into a local store and compares runs. Fixture-tested.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Local library of multi-part assemblies with hashed members. Fixture-tested.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Compares sliced outputs (3MF/gcode) as advisory differences. Fixture-tested.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Records which files a job came from and verifies them against the bytes that exist now. Registers the passport group in u1convert/cli.py. Documents the export -o output-directory race as a known limit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Checkpoint and restore of workspace state with expected_revision conflict detection, plus bounded GET-only monitoring context. Mock-service-tested; no hardware.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Tests that exercise several tracks together (creative, calibration, variants, passport, localpath); kept together because they import across tracks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The source-independence check flags /home/<name> literals. The fixture is synthetic; the path now sits under /mnt/vault. Test-literal only, made after the round-5 freeze and disclosed in the PR.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…and assemblies tracks

The routes make no network request of their own, but a mapped network drive or a path redirected as described in PASSPORT.md is read through the operating system; say so instead of "never touches the network". Narrow the PASSPORT.md evidence label to what the tests exercise. Docstrings and docs only; the passport export directory race stays open and documented.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DVOpenLabs and others added 4 commits November 13, 2026 16:51
…ect the write (R4-F1)

export -o validated the path, then created the temp file and published it by
path, leaving a window in which the directory or an ancestor could be swapped
(for example for a link to a network share). snapstudio_core/safe_publish.py
now opens the directory once and publishes through that pin: dir_fd-relative
create + no-replace link on POSIX (real path checked from the descriptor);
on Windows a directory handle without FILE_SHARE_DELETE, final path read from
the handle and checked, then create + no-replace rename.

Tests: tests/passport/test_export_publication.py swaps the directory at the
moment of first file creation and fails on the previous write path (passport
lands in the swapped-in directory); the legacy appears-before-publication test
now targets the new primitive on each platform. Full backend suite: 5241 passed
expected (one test updated), run before the test edit 5240 passed + that test.
Only the Windows pin was exercised locally; POSIX is covered by Linux CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n export publication (R4-F1 review)

Sol BLOCK on 082af75: (HIGH) an actor with write access to an empty pinned
directory could install a junction in place; (MEDIUM) unresolved
/proc/self/fd paths passed the network check; (MEDIUM) temp names grew with the
destination name and backslashes were rejected on POSIX.
Windows now creates the final name exclusively with sharing off, re-checks the
pinned directory for a reparse point, verifies the file handle's own final
path equals the verified directory plus name, and discards the empty file on a
mismatch. Linux reads the descriptor path with readlink and fails closed.
Temp names are bounded and independent of the destination; separator
rejection is platform-aware.
Tests: in-place junction and ancestor-swap regressions (fail on the old write
path); obsolete no-hard-link rename test removed (path gone), covered by the
retargeted destination-appears test.
Verified: tests/passport + review-fix tests 82 passed on Windows; full backend
5242 passed before removing the obsolete test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t failed cleanup (R4-F1 review round 2)

Sol BLOCK on c824bf0: case-folded final-path comparison could accept a junction
to a differently-cased sibling on a case-sensitive volume (HIGH); POSIX name test
still required a backslash to be rejected (MEDIUM); discard ignored a failed
disposition (LOW). Compare exact canonical paths; make the separator test
platform-aware (POSIX accepts a backslash); raise when the empty file cannot
be removed. Verified: passport + review-fix tests 82 passed on Windows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…path (R4-F1 review notes)

Opus/Sol approved 3e89141 with notes: no test reached the file-handle final-path
check, because the junction test fires before the directory re-check, and the
docs wrongly called the window untestable. Add a no-op _before_create seam
and two Windows tests (junction set exactly before the create is refused and
leaves the decoy empty; a failed disposition is reported). Correct the docs.
Verified: tests/passport 62 passed on Windows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DVOpenLabs and others added 3 commits November 14, 2026 08:07
…its of export publication

Opus and Sol approved f84829a with this note. Doc-only; no code or test change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fix(passport): pin the export output directory (R4-F1)
Base automatically changed from integ/phase2 to main November 14, 2026 17:29
DVOpenLabs and others added 4 commits November 14, 2026 12:29
… conflicting TD (approved Codex lane applied onto #140)

Applies the Opus+Sol approved Calibration tree c5c1052 (PR #148) to the #140 branch. Resolves Sol SOL-F1 on the #140 aggregate: the synthetic default physical readings and owned filaments are no longer submitted or saved as observations.

Verified: byte-identical to the approved manifest (8 files); backend calibration 34 passed; desktop 1485 passed; tsc clean.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Opus review OP140-1 on the #140 aggregate: the unsafe_xml guard was a byte-substring check, so UTF-16/UTF-32 (NUL-interleaved, auto-detected by expat) bypassed it and entities were expanded. The model is now decoded as UTF-8 (BOM allowed), any NUL is refused, DOCTYPE/ENTITY are refused case-insensitively on the decoded text, and the parser gets UTF-8 bytes.

Verified: new tests fail on the old guard (6 of 12) and pass now; tests/creative + test_scene_hostile 86 passed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@DVOpenLabs DVOpenLabs changed the title feat: Phase 2 portfolio tracks P2, P4-P8 with shared local-path guard (draft, Sol BLOCK open) feat: Phase 2 portfolio tracks P2, P4-P8 with shared local-path guard (R4-F1 fixed via #147; Opus+Sol approved f40a18d) Nov 14, 2026
@DVOpenLabs
DVOpenLabs marked this pull request as ready for review November 14, 2026 18:00
@DVOpenLabs
DVOpenLabs merged commit 9c1f85a into main Nov 14, 2026
7 checks passed
@DVOpenLabs
DVOpenLabs deleted the feat/portfolio-integration branch November 14, 2026 18:00
DVOpenLabs added a commit that referenced this pull request Nov 14, 2026
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