Skip to content

fix(snapshot): declare the calls of each snapshot procedure, read metadata with s3.read - #602

Open
mark1russell7 wants to merge 2 commits into
fix/nested-call-edgefrom
fix/snapshot-declared-calls
Open

mark1russell7 wants to merge 2 commits into
fix/nested-call-edgefrom
fix/snapshot-declared-calls

Conversation

@mark1russell7

Copy link
Copy Markdown
Owner

Summary

This change is stacked on #600. With #600, the admission skips a nested call only when its caller declares the callee in metadata.calls. The snapshot.* procedures declared no calls, so each of their nested calls goes through the admission.

  • s3.read (new): it reads an object into memory with a size limit (maxBytes, 64 MiB by default) and writes no file. Its effects read s3 and network and write nothing. procedure.new (fix(procedure): procedure.new adds the procedure to the list of definePackage() #601) made its files.
  • snapshot.list, snapshot.diff, snapshot.restore: they read the metadata of a snapshot with s3.read. Before, they used s3.download, which declares the writes of fs. A procedure that declares no writes cannot declare s3.download as a callee.
  • metadata.calls: each of the 5 snapshot procedures declares the procedures that it uses.
Procedure calls
snapshot.create git.status, git.revParse, git.remote, git.stash.list, s3.upload, s3.multipart.init, s3.multipart.upload, s3.multipart.complete, s3.multipart.abort
snapshot.list s3.list, s3.read
snapshot.restore s3.list, s3.read, s3.download
snapshot.diff s3.list, s3.read, git.revParse, git.diff, git.stash.list
snapshot.delete s3.list, s3.delete

Checks

  • checkEffects over the snapshot, s3 and git modules: 85 procedures, 5 with calls, 0 faults. The effects test of mark examines the full ecosystem in CI.
  • New tests:
    • s3.read: text and base64, no file also with a destPath in a direct call, the maxBytes refusal, a missing key.
    • The calls of each snapshot procedure are equal to the procedure paths in its source.
    • snapshot.list starts under a capability without writes, and the capability refuses s3.download.
  • Flip: with the list.ts and module.ts of fix(client): the admission examines each nested call that its caller does not declare #600, the two new snapshot tests fail. With this change, they pass.
  • Local: the tests of @procedures/s3 (93 passed, 2 skipped) and @procedures/snapshot (23 passed, 1 skipped), the typecheck of both, the API report, the conventions check and ste-lint.
  • PROCEDURES.md and PACKAGES.md get the s3.read row and the new counts. CI compares them with the generator.

Versions

  • @procedures/s3: PATCH. A new procedure and new exports, before 1.0.0.
  • @procedures/snapshot: PATCH. A fix of the declarations. The input and the output of each procedure do not change.

Merge this change after #600. Then set its base to main.

🤖 Generated with Claude Code

mark1russell7 and others added 2 commits November 15, 2026 10:59
…adata with s3.read

- s3.read (new): an object into memory with a size limit, and no file. Its
  effects read s3 and network and write nothing. procedure.new made the files.
- snapshot.list, snapshot.diff and snapshot.restore read the metadata with
  s3.read, not with s3.download (which declares the writes of fs).
- Each snapshot procedure declares metadata.calls. checkEffects finds no fault
  over the snapshot, s3 and git modules.
- Tests: s3.read (text, base64, no file, maxBytes, a missing key), the calls of
  each snapshot procedure against its source, and snapshot.list under a
  capability without writes. Both snapshot tests fail with the old list and
  module.

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

This branch has not been deployed

No deployments
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