Skip to content

docs(protocol): specify File backend format (LAB-430)#42

Merged
27Bslash6 merged 5 commits into
mainfrom
lab-430-protocol-file-backend
Jul 26, 2026
Merged

docs(protocol): specify File backend format (LAB-430)#42
27Bslash6 merged 5 commits into
mainfrom
lab-430-protocol-file-backend

Conversation

@27Bslash6

@27Bslash6 27Bslash6 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Defines the shared File backend storage contract and canonical vectors required by LAB-430.\n\nIncludes fail-closed reserved/flag negotiation, a stdlib vector verifier wired into CI, and TypeScript backend/capability matrix updates.

Summary by CodeRabbit

  • New Features

    • Added a standardised File backend format supporting deterministic filenames, expiry tracking, TTL refresh, and safe handling of unsupported flags.
    • Added canonical interoperability test vectors for permanent, expiring, Unicode-key, and unknown-flag scenarios.
  • Documentation

    • Documented the File backend format, including headers, payloads, expiry behaviour, atomic updates, and fail-closed handling.
    • Updated SDK capability documentation to clarify Node-only File and Memcached support and their TTL capabilities.
  • Tests

    • Added automated verification for File backend format compatibility and binary data integrity.

Co-authored-by: multica-agent <github@multica.ai>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 55df27e6-f91c-434a-84ce-230e8af3a61b

📥 Commits

Reviewing files that changed from the base of the PR and between b1ac9e9 and 348f15c.

📒 Files selected for processing (3)
  • spec/file-backend-format.md
  • test-vectors/file-backend.json
  • tools/file-backend-reference.py

Walkthrough

The PR defines a shared File backend format, adds canonical JSON test vectors and a standard-library validator, integrates validation into CI, and updates specification and TypeScript capability documentation.

Changes

File backend format

Layer / File(s) Summary
Format contract and canonical vectors
spec/file-backend-format.md, test-vectors/file-backend.json, README.md
Defines filename hashing, binary headers, payload and expiry semantics, flag handling, and canonical examples for permanent, future-expiry, and unknown-flag entries.
Reference validation and CI wiring
tools/file-backend-reference.py, .github/workflows/verify.yml
Validates vector-derived filenames, headers, payloads, expiry values, flags, and reader actions, then runs the validator in the verification workflow.
Capability and specification documentation
sdk-feature-matrix.md
Documents Node-only File and Memcached exports, their differing TTL capabilities, fail-closed flag handling, and vector verification.
Estimated code review effort: 3 (Moderate) ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VerifyWorkflow
  participant FileBackendReference
  participant FileBackendVectors
  VerifyWorkflow->>FileBackendReference: Runs python3 tools/file-backend-reference.py
  FileBackendReference->>FileBackendVectors: Loads canonical JSON vectors
  FileBackendVectors-->>FileBackendReference: Supplies expected encoded fields
  FileBackendReference-->>VerifyWorkflow: Returns success or validation failure
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: defining the File backend protocol format for LAB-430.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lab-430-protocol-file-backend

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

…-1784984693

# Conflicts:
#	sdk-feature-matrix.md
@27Bslash6

Copy link
Copy Markdown
Contributor Author

Resolved a conflict in sdk-feature-matrix.md (union of the two "Last updated" changelog additions — this PR's LAB-430 sentence prepended, main's LAB-272 sentence kept appended, no content dropped). Auto-rebased onto main; CI will re-run.

@kodus-27b

This comment has been minimized.

Comment thread tools/file-backend-reference.py Outdated
Comment thread tools/file-backend-reference.py
Comment thread tools/file-backend-reference.py Outdated
Comment thread tools/file-backend-reference.py Outdated

@kodus-27b kodus-27b 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.

Found critical issues please review the requested changes

Replace data-validation asserts with explicit ValueError raises so the
CI verifier cannot silently pass when asserts are stripped, and give
missing/malformed vector files a clear one-line error and exit 1.

Addresses kodus-27b review on #42 (LAB-805).

Co-authored-by: multica-agent <github@multica.ai>
@kodus-27b

This comment has been minimized.

@27Bslash6

Copy link
Copy Markdown
Contributor Author

@kody start-review

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 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 `@spec/file-backend-format.md`:
- Line 36: Update the TTL refresh requirement in the “Entries are written…”
specification so refreshing expiry bytes cannot modify the live file in place.
Require refreshes to write a temporary copy and atomically rename it into place,
or explicitly define an equivalent locking or atomic-write guarantee that every
SDK must provide.

In `@test-vectors/file-backend.json`:
- Around line 28-37: The canonical verification path lacks coverage for
preserved misses with non-zero reserved bytes. In
test-vectors/file-backend.json:28-37, add a vector with a non-zero reserved byte
and reader_action "miss_preserve"; in tools/file-backend-reference.py:40-41,
separate writer reserved-byte validation from reader negotiation so the reader
can verify and preserve the reserved value instead of rejecting the vector
before behavior is checked.

In `@tools/file-backend-reference.py`:
- Around line 43-48: Update the reader-action verification around the
expected_action calculation to incorporate expiry semantics, not just flags. Add
a deterministic reference timestamp for identifying expired entries, then assert
the specified expired-entry action separately from miss_preserve, which remains
the expected action for unknown nonzero flags. Ensure zero-flag entries are only
accepted as return_payload when they are not expired.
- Around line 30-48: Update the vector-file validation flow surrounding the loop
over document["vectors"] to validate the document shape, each vector object,
required fields, and hexadecimal values before indexing, decoding, or unpacking
them. Catch structural and decoding failures including KeyError, TypeError, and
ValueError, and report the promised one-line “invalid vector file” error with
exit code 1 instead of allowing a traceback; preserve the existing validation
checks for well-formed vectors.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9b191772-80f7-422e-8016-51857c7ea59e

📥 Commits

Reviewing files that changed from the base of the PR and between f522e3c and b1ac9e9.

📒 Files selected for processing (6)
  • .github/workflows/verify.yml
  • README.md
  • sdk-feature-matrix.md
  • spec/file-backend-format.md
  • test-vectors/file-backend.json
  • tools/file-backend-reference.py

Comment thread spec/file-backend-format.md Outdated
Comment thread test-vectors/file-backend.json
Comment thread tools/file-backend-reference.py Outdated
Comment thread tools/file-backend-reference.py Outdated
kodus-27b[bot]
kodus-27b Bot previously approved these changes Jul 25, 2026
…obust verifier

- spec: TTL refresh must not expose a torn expiry — atomic-rename path
  or a single positioned 8-byte write per POSIX.1-2017 2.9.7, with
  single-read header loads.
- vectors (1.1.0): add reserved_nonzero_preserved (fail-closed reserved
  negotiation) and expired_entry (deterministic reader_now at the >=
  expiry boundary, reader_action miss_expired).
- verifier: reserved byte is reader negotiation, not a writer check;
  reader_action derived from reserved+flags+expiry with fail-closed
  precedence; structural/hex errors exit 1 with one-line messages.

Addresses coderabbitai review on #42 (LAB-805).

Co-authored-by: multica-agent <github@multica.ai>
@kodus-27b

This comment has been minimized.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 25, 2026
@27Bslash6

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread tools/file-backend-reference.py Outdated
Addresses kodus-27b review on #42 (LAB-805).

Co-authored-by: multica-agent <github@multica.ai>
@kodus-27b

kodus-27b Bot commented Jul 26, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@27Bslash6

Copy link
Copy Markdown
Contributor Author

@kody start-review

@27Bslash6
27Bslash6 merged commit 936f22f into main Jul 26, 2026
3 checks passed
@27Bslash6
27Bslash6 deleted the lab-430-protocol-file-backend branch July 26, 2026 01:52
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