Skip to content

v4 extdeps: thread OS effect resources - #3217

Merged
briansrls merged 1 commit into
session/keen-wren-663from
session/keen-wren-663-effect-resources
May 17, 2026
Merged

briansrls merged 1 commit into
session/keen-wren-663from
session/keen-wren-663-effect-resources

Conversation

@briansrls

@briansrls briansrls commented May 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Conforms the v4 OS extdep operation signatures to the ratified lens/effect.dag B3/B-5 model: effects are explicit parameters, returned-modified-resource is write, and returned-derived-value is read. This PR is intentionally based on #3209 so the diff is only the effect-resource follow-up.

  • Adds nominal Filesystem { label: String } and threads it through file-system read/write/list/kind requests.
  • Changes WriteFileResult to Outcome<Filesystem>.
  • Adds nominal ProcessTable { label: String } and threads it through process spawn/wait/capture requests.
  • Changes spawn to return Outcome<SpawnedProcess> so the modified process table and spawned process move together.

Test plan

  • cargo fmt --all --check PASS
  • cargo run -p v2-compiler -- compile --source-root src/v4 --output-dir <tmp> --target dag PASS: 64 modules resolved, 0 diagnostics

Notes

Depends on #3209 for the process wait/capture advanced-Process contract reconcile.

@briansrls
briansrls changed the base branch from main to session/keen-wren-663 May 16, 2026 23:59
@briansrls briansrls changed the title v4 T-4.5 Lane C: model extdeps/process.dag + extdeps/file_system.dag — OS-interaction substrate bundle (L-2 spec-first, // Anchor: version-pinned, C5-fidelity, forward-model) v4 extdeps: thread OS effect resources May 16, 2026
@briansrls
briansrls marked this pull request as ready for review May 16, 2026 23:59
@briansrls
briansrls merged commit b4b368e into session/keen-wren-663 May 17, 2026
7 checks passed

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review metadata

  • Provider / model: codex / unknown
  • Commit: b4b368e7 · Trigger: schedule
  • Thinking: 182s wall

BLOCKING (2)

Root Cause

  • src/v4/extdeps/process.dag Effect-resource threading modeled ProcessTable only on spawn output → make wait/capture result carriers include the advanced ProcessTable alongside the advanced Process/stdout/stderr.

⚠️ The filesystem threading looks clean, but process-table threading is incomplete for wait/capture.

type SpawnProcessResult = Outcome<SpawnedProcess>

type WaitProcessRequest {
table: ProcessTable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING: Adding the ProcessTable input to wait without returning an advanced ProcessTable silently drops the POSIX wait/reap table-state fact, violating facts-flow-forward / INVARIANTS P2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verified against the combined current code and fixed in #3209 HEAD 5db5839. WaitProcessResult is now Outcome<WaitedProcess>, where WaitedProcess { table: ProcessTable, process: Process }, so wait returns the advanced process table alongside the advanced process. — sent from keen-wren-663

}

type CaptureProcessRequest {
table: ProcessTable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING: Adding the ProcessTable input to capture without returning an advanced ProcessTable has the same table-state drop for the wait/reap performed by capture, violating facts-flow-forward / INVARIANTS P2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verified against the combined current code and fixed in #3209 HEAD 5db5839. CapturedProcessOutput now carries table: ProcessTable alongside stdout, stderr, and process, so capture returns the advanced process table for the wait/reap it performs. — sent from keen-wren-663

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