Repository navigation
feat: git push stores packs on your own storage (S3 SigV4, IPFS, Platform) with N-of-M replication - #12
Merged
Conversation
S3: hand-rolled AWS SigV4 (header auth + presigned URLs) on the sha2/hmac already in the tree, pinned by the AWS SigV4 test-suite vectors and the S3 API reference examples. PUT/GET/HEAD/DELETE, path-style and virtual-hosted addressing, STS session tokens, real x-amz-content-sha256, unsigned public reads through the profile's public URL, content-addressed keys under an optional prefix. IPFS: kubo add with pinned import parameters; the returned CID must equal a local CIDv1 raw-leaves derivation (cid.rs) and be pinned. Optional remote pin through an IPFS Pinning Service API endpoint. The docker fixtures gain a forge-byo bucket that refuses anonymous writes, and live tests cover signed ops, CID parity and replication. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…cing reader storage::profiles: ~/.config/dash-forge/storage.toml named targets (s3 | ipfs-kubo | ipfs-pinning-service | platform) whose secrets are env:/keychain: references resolved into the redacting Secret; literal secrets are refused. storage::policy: dash.storage / dash.replicas / dash.platformFallback resolution. storage::targets: the StorageTarget seam, ExternalTarget with re-read verification, and replicate() (N-of-M, externals in parallel, Platform last and only if N is still reachable). storage::read: PackReader races recorded URIs plus a configurable gateway list, hash-verified. repo.rs: PlatformChunkTarget (the one contract-model-specific target), RepackTarget::Replicated for packs and browse-index artifacts, fetch_artifact with Platform chunks as last resort, set_backend for advertising read URIs. The default gateway list lives once in forge-contracts/config/storage-defaults.json, replacing the hard-coded ipfs.io. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…d repack/reseed dg storage test puts/gets/deletes a probe object, checks the public read URL and browser CORS, and prints the exact provider CORS config to paste. dg storage use writes dash.storage/dash.replicas; advertise writes the policy's mode and public read URLs to config.backend. repack/reseed take --profile; status and release download use the configured gateway list. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…age guide make storage-it runs the MinIO/kubo integration tests with fixtures required; make storage-e2e drives a real git push/clone over dash:// with packs on local MinIO + kubo. docs/guides/bring-your-own-storage.md covers R2, B2, AWS S3, MinIO, kubo and pinning services with CORS configs; PRD 04 gains as-built notes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Push resolves dash.storage/dash.replicas, prints what goes where and the Platform estimate, applies the dash.costWarnThreshold/dash.confirm guard (/dev/tty; refuses with a fix when there is no terminal), replicates the pack to every target in parallel with verification, and writes the packManifest (every confirmed URI + sha256) and only then the refs. Fewer than N confirmations fail the push before anything is written to Platform. Fetch reads through the gateway-racing reader with Platform chunks as the fallback. No policy = Platform only, as before, with the resumable chunk journal. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… findings S3: refuse empty/./.. key segments in key_of and api_url, and assert in prepare that the signed path equals the intended bucket+key path, so a hostile s3:// URI cannot steer a signed request at another key or bucket. Use a no-redirect client (signed requests cannot survive a redirect; following one would carry x-amz-security-token), echo only an error document's Code/Message (never the canonical request), reject userinfo/query/fragment in endpoint and public URLs without echoing unparseable values, refuse virtual-hosted addressing on an IP endpoint, send x-amz-content-sha256 on anonymous PUTs, and add reput for the verify-failed repair path. IPFS: truncate pinning-service error bodies on a char boundary (a multi-byte character at byte 400 panicked). Both: size-capped reads (PackBackend::get_capped) so a hostile host cannot stream without end. Live test: a 175-leaf (~44 MiB) two-level dag-pb tree matches kubo's CID. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Replication::uris puts the platform:// locator first whenever a Platform copy exists (released helpers read uris[0] of a storage=0 manifest as the chunk locator). replicate and manifest_uris refuse required=0, no targets, or an empty URI list. ExternalTarget verifies IPFS through the node's own gateway (public gateways lag on fresh CIDs) and re-uploads once when a stored copy fails verification. PackReader resolves S3 secrets only when an s3:// candidate is tried (no keychain prompt on a plain fetch), keeps every profile for a bucket, skips bad-segment keys, caps every body at the manifest's sizeBytes and bounds each candidate at 120s; fetch_artifact gives external copies a 90s budget before the Platform fallback. Profiles: TOML errors report line + message only (never the source line that may hold a pasted secret); URLs with userinfo/query/fragment are refused. RepoService::read_pack_manifest reads one manifest by packHash. pick_scoped defines dash.* vs remote.<name>.dash* precedence by git config scope. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…nly errors When the pack's packManifest already exists (an earlier push recorded it), read it back and require at least one recorded copy to be readable and hash-match before writing refs; otherwise fail with 'pack already recorded at <uris>, none reachable; restore that storage or run dg reseed', listing the copies this push confirmed so they can be recorded later. Platform-only (no policy) pushes keep the pre-policy 'uploading pack chunks' context and the typed chunk error instead of policy/fallback advice. Secrets resolve before the cost prompt; /dev/tty is opened only when the guard could ask; dry-run prints the plan; delete-only pushes do not load the policy; the chunk journal is kept (with a note) when a push switches away from Platform; per-remote vs repo-wide settings follow git config scope. DASH_FORGE_FAIL_BEFORE_REFS is a test affordance for the e2e. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…edirect storage I/O dg storage advertise reads dash.* and remote.<name>.dash* (--remote) with the same git-config-scope precedence as the helper, including dash.platformFallback, and still publishes only https public read bases. dg storage test uses the no-redirect S3 client; release download caps the body at the asset's recorded size. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
git exports GIT_DIR to remote helpers, and git honours GIT_DIR over -C. The completed-then-reordered push-pack candidate (PR #4) runs 'git -C <scratch> init --bare' to build a scratch odb, which therefore re-initialised the USER's repository with core.bare = true, and its scratch index-pack/pack-objects ran against the user's odb. After any push with a have-base, 'git add' / 'git commit' in the user's worktree failed with 'this operation must be run in a work tree'. The live storage-byo e2e caught it on its third push. git_capture now clears GIT_DIR, GIT_WORK_TREE, GIT_COMMON_DIR, GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY and GIT_ALTERNATE_OBJECT_DIRECTORIES, so every call operates on exactly the -C directory it names (build_pack is always handed the absolute git dir). A regression test sets GIT_DIR as git does and asserts core.bare stays false; it fails without the fix. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ument the fixes
storage-byo.sh gains scenario 5: store a pack on MinIO only, stop after the manifest (DASH_FORGE_FAIL_BEFORE_REFS), delete that MinIO object, then push the same pack to kubo only; the push must refuse ('already recorded at …, none reachable'), name the new ipfs:// copy, and leave the remote ref unmoved. The guide documents that s3:// locators disclose the bucket name and prefix on-chain, the reader limits, dry-run output and the new error messages; PRD 04 as-built notes record the fixes, the bare-repo bug, and what was verified live.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… quoted values in errors Reads: a candidate's whole-transfer deadline is max(120 s, size / 1 MiB/s) — a flat 120 s failed every clone of a large external-only pack — with the client's 120 s idle read_timeout still cutting off stalled hosts; the external budget before a Platform fallback becomes 'start no new candidate after max(90 s, half the deadline)' (a fetch_verified argument; the unused with_budget builder is gone), so a big pack streaming from a healthy mirror is never abandoned. dg release download gets the same scaling from the asset's size. Policy: git config --show-scope needs git >= 2.26; on older git the value was silently dropped (dash.storage ignored, cost guard off). git_config_scoped now falls back to plain --get and reports the scope as local; a test simulates the old-git failure. dg storage advertise uses it. Errors: TOML parse errors strip every quoted run (serde quotes offending values, e.g. a secret pasted into path_style); the S3 endpoint error no longer echoes the path. Unsigned public-URL reads follow redirects (a CDN or http->https 301 is normal there); signed S3 requests still never do. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…clone A manifest is immutable, so a pack whose recorded copies are all gone can only be made readable again by putting its exact bytes back where the manifest points. Keys are content-addressed (S3 <prefix>/packs/<sha256>.pack, the IPFS CID), so re-uploading through the original profile recreates the recorded URI. dg reseed <repo> --from-local [GIT_DIR] [--pack H] [--profile P] [--force] finds each unreadable live pack's bytes in the clone — .git/dash/packs/<sha256>.pack (kept by the helper for every externally stored push) or a fetched objects/pack/pack-*.pack — verifies the SHA-256, uploads to the repo's dash.storage targets (or --profile) with N-of-M replication, reports which recorded copies are readable again, and announces NEW locations as packMirror docs where the contract has that type (repo-v1 does not: they are printed). Also: forge-core gains a test-hooks feature gating DASH_FORGE_KILL_AFTER_CHUNK out of normal builds; fetch_artifact_from/fetch_manifest_pack share one contract per fetch and read through the gateway-racing reader. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…cal copy The existing-manifest check now runs BEFORE storing: a still-readable recorded pack is not stored again; an unreadable one fails before any upload or chunk is paid for, pointing at dg reseed --from-local. A Platform-tier manifest of the same size and chunk count is accepted without re-downloading the pack (its chunks were confirmed at consensus). Externally-only stored packs are kept at .git/dash/packs/<sha256>.pack before the manifest names them, so the pusher can always restore them. Fetch keeps PR #10's behaviour — an external-only pack whose copies are unreachable is skipped with a warning; git still fails the fetch if a wanted object never arrived — now through the size-bounded reader. DASH_FORGE_FAIL_BEFORE_REFS is compiled only with the new test-hooks feature. Old git: config reads go through the --show-scope fallback. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…eseed --from-local The storage e2e no longer touches the shared m1-75299 repo (its packs live on localhost MinIO/kubo, unreadable to other suites). Steps 1-4 use storage-e2e-a, steps 5-6 storage-e2e-b — DEPLOYER-owned, created once by the script if absent, reserved in the new e2e/README.md, defaults in config.sh (STORAGE_E2E_REPO / STORAGE_E2E_REPO_B). Each run uses fresh branches and deletes them. Step 5 now asserts the refusal happens before anything is stored and points at reseed --from-local; step 6 restores the deleted MinIO object with dg reseed --from-local, re-pushes, and proves repo B is clonable afterwards. make storage-e2e builds the helper with test-hooks. Docs: a 'Restoring a lost copy' section (what an immutable manifest means, content-addressed keys, --from-local vs plain reseed, repo-v1 vs packMirror); the reader limits, the troubleshooting row and PRD 04 as-built notes updated; header and Limits-list nits fixed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 57 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (38)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 25, 2026
Merged
PastaPastaPasta
added a commit
that referenced
this pull request
Oct 5, 2026
Now that the sinks (#370) are on master, a notice for a members-only event says what happened ("alice posted a members-only comment on issue #12", "alice opened members-only pull request #4", "approved ... in a members-only review") and never quotes the empty text or a members-only thread's missing title. Also formats the previous commit's test call sites. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta
added a commit
that referenced
this pull request
Oct 28, 2026
- A board spanning repositories showed each card's whole owner/name label: a 44-character identity id that truncated the number away on cards and cut table titles to one letter. Cards, table rows, roadmap lines and the item panel now show `name #12` (ItemRef), the full label as the tooltip; repo: matches an owner's whole id or DPNS name for every repository, not a shortened id nobody can type. - The table's Group picker had no None, and picking Status cleared the grouping: a table could not be grouped by Status at all. - A roadmap could not be switched to plot two date fields when the board has an iteration field: a Dates picker sets view.date. - The item panel sat 12px down the viewport (the page's space-y margin on a fixed layer); it stayed open on "Item not on this board" after Remove; its link read "Open issue" beside the state "Open issue". - A keyboard move into another column lost the focus (the card's new element renders after the drop); it is now refocused there. - A label defined from the item panel showed the fallback colour on the cards until a reload: the page reads the definitions again when an item carries a label they lack. - Light-theme contrast: the drag ghost's dark-mode note and the card and settings grips (lib/design/contrast.test.ts). - "Show archived" shows only archived items: renamed "Only archived". The filter box's example names this board's columns and fields; a single unresolved qualifier "names nothing"; settings no longer says closed items go to Done on a board without one; quick add says "Puts #7 in Done" (it moves an item already on the board). - Settings' column and field rows line up whatever chips they carry; the new-board templates read from the top; the Boards list puts the most recently changed board first; the issue sidebar's controls share one height; the roadmap's today marker no longer crosses header labels. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Implements roadmap Phase 1 (D-B, bring your own storage):
git pushstores packs where the repo's owner decides, on an S3-compatible bucket (AWS S3, Cloudflare R2, Backblaze B2, MinIO), an IPFS node or Pinning Service API, and/or Platform. Manifests and refs stay on Platform. The Forge project hosts nothing.Before this PR,
git pushalways wrote Platform chunks (storage: 0) regardless of config. S3 had no SigV4, IPFS was only reachable through a local kubo, and reads were pinned tohttps://ipfs.io.Storage profiles (
dg storage add | list | remove | test | use | advertise | status)~/.config/dash-forge/storage.toml(or$DASH_FORGE_STORAGE_CONFIG). Kinds:s3 | ipfs-kubo | ipfs-pinning-service | platform.env:VAR, orkeychain:service/accountviasecurityon macOS /secret-toolon Linux). They resolve into the redactingkeystore::Secret.dg storage test <profile>does a signed put, get and delete of a probe object, then an anonymous read of the public URL and a CORS check (GET origin,Rangepreflight,Content-Rangeexposure). On failure it prints the exact CORS JSON to paste for R2, B2, AWS or MinIO.Repo policy (local git config, because the credentials are local)
dash.storage = "r2-main,kubo",dash.replicas = N,dash.platformFallback, andremote.<name>.dash*overrides.--show-scope) the keys are read with plain--get, never dropped.config.backendonly advertises the mode and the https public read bases (dg storage advertise). The repo-v1 schema is unchanged.git pushdash: pack 444 B → minio, kubo (need 2 of 2); Platform: manifest + refs only, est. 0.000373 DASH.dash.costWarnThreshold/dash.confirm). It asks on/dev/ttyand, without a terminal, fails with the fix.StorageTargetseam. Every upload is re-read and hash-verified (full GET up to 16 MiB; above that, size plus head/tail ranges), with one re-PUT if verification fails.packManifestwith every URI plus the SHA-256. When a Platform copy exists,platform://goes first so released helpers can still read it.<prefix>/packs/<sha256>.pack, CIDs), so a re-push is idempotent.dg reseed --from-local.repo::PlatformChunkTargetis the only contract-model-specific piece, so it's the seam for the PV14 forge-v2 contract.Backends
sha2/hmacalready in the tree.aws-sigv4would pull in the smithy HTTP stack andrusty-s3a second RustCrypto major version..and..segments are rejected in key_of and in the reader, and the signed path is asserted equal to the intended one.<Code>/<Message>.addruns with pinned parameters. The CID must equal a local CIDv1 raw-leaves derivation, including multi-level balanced trees, and must show as pinned. The optional Pinning Service API client reuses an existing pin, orPOST /pinswithoriginsand polls untilpinned.Reads
PackReaderraces the recorded https URLs, then signed GETs fors3://locators when a local profile exists (secrets resolved lazily), then every CID on a configurable gateway list, two at a time.sizeBytes, and givenmax(120 s, size ÷ 1 MiB/s).max(90 s, half that).forge-contracts/config/storage-defaults.json.Recovery:
dg reseed --from-local.git/dash/packs/<sha256>.packfor every pack it stores externally only. Fetched clones hold the exact bytes asobjects/pack/*.pack.--from-localfinds the pack locally, verifies it, and re-uploads to the policy's targets. Content-addressed keys mean this recreates the URI the immutable manifest records.packMirrordocs where the contract has that type; repo-v1 prints them.Found and fixed along the way (pre-existing, from PR #4)
git pushturned the user's repository bare. git exportsGIT_DIRto remote helpers, andgit -C <scratch> init --barein the push-pack builder then re-initialised the user's repo withcore.bare = true. After that,git add/git commitfailed with "must be run in a work tree".pack::build::git_capturenow clears the repo-location variables. A regression test is included, and it fails without the fix.Verified live: local MinIO + kubo only, per D-K
make storage-it: 54 tests, with fixtures required so none can silently skip.make storage-e2e: realgit push/git cloneon testnet, against two dedicated DEPLOYER-owned repos,storage-e2e-aandstorage-e2e-b, reserved ine2e/README.md. They were created once, and each run uses fresh branches. Final run: all 6 scenarios PASS.storage=1, chunkCount=0with the public URL, thes3://locator and the CID.fsck --strict.dg reseed --from-localrestores the exact recorded object; the re-push then lands without storing again, and a fresh clone of repo B works.cargo fmt --all -- --check,cargo clippy --locked --workspace --all-targets -- -D warnings(also with--features test-hooks), andcargo test --locked --workspaceare all green.Not verified against real services
Deferred
packMirrorannouncements from push itself.Notes
DASH_FORGE_FAIL_BEFORE_REFSandDASH_FORGE_KILL_AFTER_CHUNKare now compiled only with thetest-hooksfeature.m1-75299repo and left localhost-backed manifests on it. PR fix: make the Testnet Nightly green and trustworthy #10 made the fetch path skip those, and that repo is being handled separately. This PR never touches it.🤖 Generated with Claude Code