Skip to content

repository: Add meta.json for repo metadata and cfsctl init#268

Open
cgwalters wants to merge 3 commits intocomposefs:mainfrom
cgwalters:meta-json
Open

repository: Add meta.json for repo metadata and cfsctl init#268
cgwalters wants to merge 3 commits intocomposefs:mainfrom
cgwalters:meta-json

Conversation

@cgwalters
Copy link
Collaborator

Add a meta.json file to the repository format that records the digest
algorithm, format version, and feature flags, so tools can auto-detect
the configuration instead of requiring --hash on every invocation.

The versioning model is inspired by Linux filesystem superblocks
(ext4, XFS, EROFS): a base version integer for fundamental layout
changes, plus three tiers of feature flags for finer-grained
evolution:

  • compatible: old tools can safely ignore
  • read-only-compatible: old tools may read but must not write
  • incompatible: old tools must refuse the repository entirely

Because creating a repo is no longer just mkdir, add
'cfsctl init --algorithm=fsverity-sha512-12 [path]'.

Closes: #181

Add a validated Algorithm type that wraps the fsverity-<hash>-<lg_blocksize>
string format (e.g. 'fsverity-sha512-12'). Implements FromStr for parsing
with proper error types and Display for serialization, so it can be used as
a clap value_parser argument. Includes for_hash::<H>() constructor to
derive from FsVerityHashValue types at compile time.

Prep for repository metadata support.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
Prep for repository metadata (meta.json) serialization.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
Add a meta.json file to the repository format that records the digest
algorithm, format version, and feature flags, so tools can auto-detect
the configuration instead of requiring --hash on every invocation.

The versioning model is inspired by Linux filesystem superblocks
(ext4, XFS, EROFS): a base version integer for fundamental layout
changes, plus three tiers of feature flags for finer-grained
evolution:

  - compatible: old tools can safely ignore
  - read-only-compatible: old tools may read but must not write
  - incompatible: old tools must refuse the repository entirely

Because creating a repo is no longer just `mkdir`, add
'cfsctl init --algorithm=fsverity-sha512-12 [path]'.

Closes: composefs#181

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
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.

repo metadata

1 participant