Skip to content

feat: own the index and log entry format in one model - #25

Merged
leoafarias merged 1 commit into
mainfrom
feature/15-index-log-model
Aug 21, 2026
Merged

feat: own the index and log entry format in one model#25
leoafarias merged 1 commit into
mainfrom
feature/15-index-log-model

Conversation

@chrishiguto

@chrishiguto chrishiguto commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Why

Rules, prepared writes, and MCP writes must not carry competing copies of the index.md and log.md entry grammar.

What

Adds OkfIndexDocument and OkfLogDocument as the shared parser/emitter owner. The index generator and fixed Spec rules consume that model while bundles continue to retain reserved files as raw text.

Writable models canonicalize entry text, preserve the intended index order, sort log date groups newest-first, and refuse states that cannot round-trip—including CR/LF-bearing links. Parse results retain malformed input for rule reporting and cannot be converted into writable documents while issues or unsupported frontmatter remain.

Reviewer's guide

Start with lib/src/index_log.dart, then lib/src/index_generator.dart, lib/src/spec_rules/context.dart, and lib/src/spec_rules/reserved_rules.dart. This is cleanly restacked on the merged graph query work.

Testing

  • Formatting and fatal-info analysis are clean.
  • All 123 tests pass.
  • Entry round trips, malformed-input reporting, CR/LF rejection, validator-compatible emission, and byte-identical existing index generation are covered.
  • dart pub publish --dry-run reports zero warnings.

Links

Part of #15. BundleChangeSet consumption lands in #27.

@chrishiguto
chrishiguto force-pushed the feature/15-index-log-model branch from 0d281b4 to 804553a Compare August 19, 2026 14:03
Base automatically changed from feature/10-graph-query-filters to main August 21, 2026 15:37
@leoafarias
leoafarias force-pushed the feature/15-index-log-model branch from fa2486d to 148fb81 Compare August 21, 2026 16:11
@leoafarias
leoafarias merged commit 6d31ae7 into main Aug 21, 2026
5 checks passed
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.

2 participants