Skip to content

docs(openspec): reconcile dechunk skip-vs-purge spec layering - #1344

Merged
kalbasit merged 2 commits into
mainfrom
clarify-dechunk-skip-vs-purge-layering
Jun 7, 2026
Merged

kalbasit merged 2 commits into
mainfrom
clarify-dechunk-skip-vs-purge-layering

Conversation

@kalbasit

@kalbasit kalbasit commented Jun 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

The chunks-to-nar-migration spec read as self-contradictory: one requirement said an unverifiable chunked NAR is skipped and not deleted, while another said the de-chunk pass purges unverifiable NARs to drive the chunked count to zero. CodeRabbit flagged the ambiguity on #1342.

Tracing the code shows no behavioral conflict — only two layers the spec failed to distinguish:

  • The single MigrateChunksToNar operation is verified-or-nothing: when it cannot resolve a NarHash it signals ErrNoNarHashToVerify and leaves the NAR chunked, never deleting it (pkg/cache/cache.go:8398-8408).
  • The batch pass purges what the operation declined to de-chunk, driving the chunked count to zero — and leaves the NAR chunked only on context cancellation (pkg/ncps/migrate_chunks_to_nar.go:419-462).

This reconciles the spec by making the operation-vs-pass layering explicit in both requirements and the affected scenarios. Spec-only — no code change (the implementation already matches the documented policy).

Test plan

  • openspec validate chunks-to-nar-migration passes
  • No code change; behavior unchanged (verified against MigrateChunksToNar and the batch driver)

The chunks-to-nar-migration spec read as self-contradictory: one
requirement said an unverifiable chunked NAR is skipped and not deleted,
while another said the pass purges unverifiable NARs to drive the chunked
count to zero. CodeRabbit (PR #1342) flagged the ambiguity.

Tracing the code shows no behavioral conflict, only two layers the spec
failed to distinguish: the single MigrateChunksToNar operation skips
(signals ErrNoNarHashToVerify, leaves the NAR chunked, never deletes), and
the batch pass purges what the operation skipped to drive the count to
zero (leaving it chunked only on context cancellation). Reword both
requirements and the affected scenarios to make that operation-vs-pass
layering explicit. Spec-only; no code change (the implementation already
matches).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@kalbasit

kalbasit commented Jun 7, 2026 •

Copy link
Copy Markdown
Owner Author

This change is part of the following stack:

Change managed by git-spice.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. documentation Improvements or additions to documentation labels Jun 7, 2026
@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9833858d-0c69-4f41-be6e-4970baa0fb44

📥 Commits

Reviewing files that changed from the base of the PR and between 9f8a236 and 1e50f16.

📒 Files selected for processing (5)
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/design.md
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/proposal.md
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/specs/chunks-to-nar-migration/spec.md
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/tasks.md
  • openspec/specs/chunks-to-nar-migration/spec.md
✅ Files skipped from review due to trivial changes (3)
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/proposal.md
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/design.md
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/tasks.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/specs/chunks-to-nar-migration/spec.md
  • openspec/specs/chunks-to-nar-migration/spec.md

📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Clarified the chunks-to-nar-migration spec to resolve contradictions and explicitly define layered behavior: single-operation "skip" vs. batch-pass "purge/drive-to-zero".
    • Updated requirements and scenarios for unverifiable NAR hashes, reconstruction failures, and cancellation handling so passes leave no chunked rows except on interruption.
  • Chores

    • Added repository metadata file for the new spec archive.

Walkthrough

Documentation clarifies skip vs purge layering: the single MigrateChunksToNar operation is verified-or-nothing (returns ErrNoNarHashToVerify and leaves NARs chunked when unverifiable); the batch migrate-chunks-to-nar pass purges unverifiable or failed NARs to drive total_chunks to zero, except on cancellation. No code changes.

Changes

Chunks-to-NAR migration skip vs purge clarification

Layer / File(s) Summary
Clarification proposal and design rationale
openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/proposal.md, openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/design.md
Proposal and design define two-layer policy: single operation is verified-or-nothing (skip = leave chunked via ErrNoNarHashToVerify), batch pass purges unverifiable/failed NARs to drive chunked count to zero.
Archive specification with detailed scenarios
openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/specs/chunks-to-nar-migration/spec.md
Archive spec adds hash-aware narinfo URL matching rules (normalize/strip prefixes), scenarios for canonical and prefixed URLs, verified-or-nothing single operation, pass-level purge behavior, and cancellation exception.
Main specification updates
openspec/specs/chunks-to-nar-migration/spec.md
Live spec tightened: NarHash resolution normalization and matching, single MigrateChunksToNar returns ErrNoNarHashToVerify when unverifiable and must not modify NAR, batch pass must purge unverifiable/reconstruction failures and must not purge on cancellation.
Metadata and task documentation
openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/.openspec.yaml, openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/tasks.md
Adds .openspec.yaml metadata and task checklist confirming openspec validate passes; documents that no code changes were required.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • kalbasit/ncps#1334: Implements purge-on-unverifiable behavior and narinfo URL normalization that align with this spec clarification.
  • kalbasit/ncps#1333: Adds narURL-based fallback for NarHash resolution in MigrateChunksToNar, affecting when the operation can verify vs skip.
  • kalbasit/ncps#1319: Related migrate/drain hardening changes that interact with pass-level purge semantics.

Suggested labels

size:L, documentation

Poem

🐰 A rabbit reads specs by moonlight bright,
Skip keeps chunks safe when hash isn't right,
The pass comes later to tidy the mess,
Unless cancelled—then let chunks rest.
Hooray for clarity, tidy and light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main change: reconciling the openspec documentation to resolve the apparent contradiction between 'skip' and 'purge' behavior in the dechunk spec by making the operation-vs-pass layering explicit.
Description check ✅ Passed The PR description is directly related to the changeset, providing context about the spec contradiction, the implementation layers involved, and explaining that this is a documentation-only change with no code modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request clarifies the chunks-to-nar-migration specification by clearly separating the single-NAR operation behavior (which skips unverifiable NARs) from the batch-pass behavior (which purges them). The review feedback recommends correcting the hyphenated spelling of 'un-verifiable' to 'unverifiable' across the specification, proposal, and archived spec files to maintain consistency.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/proposal.md`:
- Around line 7-8: The proposal's line references are inconsistent; update all
referenced ranges so they match the authoritative code positions for the two
symbols: Cache.MigrateChunksToNar and PurgeChunkedNar (the batch pass that calls
PurgeChunkedNar). Locate the canonical line ranges by opening the source for the
functions Cache.MigrateChunksToNar and the batch pass that invokes
PurgeChunkedNar, then make the proposal, tasks.md, and PR objectives use that
exact authoritative range (same numbers everywhere) and verify the ranges cover
the full relevant blocks mentioned in the text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9158e41-3c7c-4d7c-8727-83b807d88d09

📥 Commits

Reviewing files that changed from the base of the PR and between 244b6cf and 9f8a236.

📒 Files selected for processing (6)
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/.openspec.yaml
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/design.md
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/proposal.md
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/specs/chunks-to-nar-migration/spec.md
  • openspec/changes/archive/2026-06-06-clarify-dechunk-skip-vs-purge-layering/tasks.md
  • openspec/specs/chunks-to-nar-migration/spec.md

Address review on #1344: use the unhyphenated "unverifiable" in the
reworded scenario title (matching the rest of the spec and the proposal),
and reconcile the cache.go / migrate_chunks_to_nar.go line references so
proposal.md, design.md, and tasks.md all cite the same authoritative
ranges (cache.go:8398-8408, migrate_chunks_to_nar.go:419-462) — the
positions shifted when #1342 merged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@kalbasit
kalbasit enabled auto-merge (squash) June 7, 2026 06:11
@kalbasit
kalbasit merged commit 46d9ee0 into main Jun 7, 2026
35 checks passed
@kalbasit
kalbasit deleted the clarify-dechunk-skip-vs-purge-layering branch June 7, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant