Skip to content

docs: document closure pinning feature (#1021) - #1370

Merged
kalbasit merged 2 commits into
mainfrom
user/wnasreddine/document-pin-feature
Jun 8, 2026
Merged

kalbasit merged 2 commits into
mainfrom
user/wnasreddine/document-pin-feature

Conversation

@kalbasit

@kalbasit kalbasit commented Jun 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closure pinning shipped in #1108 — the POST/DELETE /pin/{hash}.narinfo and GET /pins endpoints that protect a narinfo and its transitive references from LRU eviction — but was never documented, leaving #1021 open. This PR documents it.

  • New page docs/docs/User Guide/Features/Pinning.md (modeled on the existing CDC feature page): overview of why to pin, the three HTTP endpoints with status codes, idempotency notes, the unknown-hash 404 case, and worked curl examples (including the empty /pins response). All behavior is derived from pkg/server/server.go and pkg/cache/cache.go so the docs match the spec.
  • Published in the nav tree: registered the page in the Trilium export index (docs/!!!meta.json) under the features note with a pinning slug.
  • Cross-links: from Cache Management (new "Protecting Paths from Eviction" subsection + Related Documentation) and Getting Started → Concepts (Storage Requirements) where LRU eviction is introduced.
  • Spec + OpenSpec: added a documentation requirement to the closure-pinning spec and archived the document-closure-pinning change.

No code, API, schema, or runtime behavior changes.

Closes #1021.

Test plan

  • task fmt clean (0 files changed)
  • docs/!!!meta.json parses as valid JSON; Pinning note registered with a unique noteId
  • openspec validate --specs passes for closure-pinning
  • Reviewer: confirm documented endpoints/status codes match the implementation
  • n/a task lint / task test — documentation-only change, no Go/SQL touched

Closure pinning shipped in #1108 (POST/DELETE /pin/{hash}.narinfo and
GET /pins, which protect a narinfo and its transitive references from
LRU eviction) but was never documented, leaving #1021 open.

Add a User Guide > Features > Pinning page modeled on the existing CDC
page: an overview of why to pin, the three HTTP endpoints with status
codes, idempotency, and worked curl examples. All documented behavior
is derived from pkg/server/server.go and pkg/cache/cache.go so the docs
cannot drift from the spec.

Register the page in the Trilium export index (docs/!!!meta.json) under
the features note so it publishes, and cross-link it from Cache
Management (LRU cleanup) and Getting Started > Concepts where eviction
is introduced. Sync the closure-pinning spec with a documentation
requirement and archive the OpenSpec change.

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

kalbasit commented Jun 8, 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:L This PR changes 100-499 lines, ignoring generated files. documentation Improvements or additions to documentation labels Jun 8, 2026
@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This pull request adds user-facing documentation for the Closure Pinning feature, covering the pin, unpin, and list HTTP endpoints; their request/response formats; idempotency guarantees; and LRU-eviction protection semantics. The feature page is registered in the documentation hierarchy and cross-linked from related guides, with accompanying OpenSpec specification and planning records.

Changes

Closure Pinning Feature Documentation

Layer / File(s) Summary
Pinning Feature Page and Navigation Registry
docs/docs/User Guide/Features/Pinning.md, docs/!!!meta.json
Adds a new Pinning feature page documenting the three HTTP endpoints (POST /pin/{hash}.narinfo, DELETE /pin/{hash}.narinfo, GET /pins), their success/error response codes, idempotency behavior, and explanation that pinning protects a store path and its transitive closure from LRU eviction. The page is registered in docs/!!!meta.json under Features with a stable shareAlias for navigation discovery.
Cross-linking from Related Documentation
docs/docs/User Guide/Getting Started/Concepts.md, docs/docs/User Guide/Usage/Cache Management.md
Adds a "Pinning" bullet under Storage Requirements in Concepts explaining protection against LRU eviction, and adds a "Protecting Paths from Eviction" section in Cache Management describing how LRU cleanup works and instructing readers to pin closures, plus a related-documentation link to the Pinning page.
OpenSpec Specification and Planning Records
openspec/changes/archive/2026-06-08-document-closure-pinning/*, openspec/specs/closure-pinning/spec.md
Records the design, proposal, documentation requirements spec, and task checklist for the pinning documentation effort in the OpenSpec archive, and updates the main closure-pinning spec with documentation requirements (page placement, endpoint documentation, idempotency, eviction-protection semantics, curl examples, and cross-linking from LRU/cache guidance).

🎯 2 (Simple) | ⏱️ ~8 minutes

documentation, size:M

🐰 A feature pinned down with care,
Closures safe from eviction's snare,
Docs now guide the path so clear,
LRU won't touch what's precious here! 📌

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: documenting the closure pinning feature and closing issue #1021.
Linked Issues check ✅ Passed The PR fully addresses issue #1021 by adding comprehensive documentation for the closure pinning feature, enabling users to understand the API and behavior as required.
Out of Scope Changes check ✅ Passed All changes are scoped to documentation: new Pinning.md feature page, metadata registration, cross-links, and spec updates; no code or API changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly explains the documentation being added for the closure pinning feature, including the new Pinning.md page, navigation registration, cross-links, and spec updates, all directly related to the changeset.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@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 adds comprehensive user-facing documentation for the closure pinning feature. It introduces a new 'Pinning' page under the Features section, registers it in the documentation metadata, and cross-links it from the Cache Management and Concepts guides. Additionally, it includes the corresponding design proposal, tasks, and specification updates under the openspec directory. No review comments were provided, so there is no feedback to address.

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.

@kalbasit
kalbasit enabled auto-merge (squash) June 8, 2026 05:10
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@kalbasit
kalbasit merged commit c767ac8 into main Jun 8, 2026
38 checks passed
@kalbasit
kalbasit deleted the user/wnasreddine/document-pin-feature branch June 8, 2026 05:15
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:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: pin store paths to prevent garbage collection

1 participant