Skip to content

Keep frontmatter dates as written; bundle an OKF v0.2 schema - #144

Merged
mindsocket merged 5 commits into
mainfrom
feat/preserve-frontmatter-timestamps
Oct 7, 2026
Merged

mindsocket merged 5 commits into
mainfrom
feat/preserve-frontmatter-timestamps

Conversation

@mindsocket

@mindsocket mindsocket commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Closes #143

Frontmatter dates and datetimes (breaking)

  • Frontmatter and embedded YAML blocks are loaded without YAML's timestamp type, so dates and datetimes stay exactly as written: no truncation to YYYY-MM-DD, offsets kept, and dates inside lists are no longer left as Date objects. This replaces coerceDates.
  • Render and template output write dates unquoted using the same YAML settings. Date values (e.g. from non-markdown sources) are written as ISO 8601 strings.
  • Formats:
    • date-time: seconds and a UTC offset required.
    • date-or-date-time: a date, or a datetime with optional seconds and offset, as Obsidian writes them.
    • All three date formats reject impossible values (2026-02-30, 25:00).
    • The knowledge wiki's published_date and note date now use date-or-date-time.
  • docs/rules.md and the README filter section cover comparing dates with $toMillis(), including how datetimes without an offset are read and its need for seconds.

Migration: a field with format: "date" that holds datetimes now fails; use date-or-date-time. Rules and filters that compare date strings directly should use $toMillis().

OKF schema

  • Adds schemas/_okf.json and schemas/okf.json for Open Knowledge Format v0.2 bundles, validated as plain markdown spaces.
  • Any concept type is accepted and unknown fields are tolerated.
  • Four rules: description, stale_after ordering, usage_count window, and computation presence.
  • Reserved index.md / log.md show up as excluded during parsing.

Other

  • AGENTS.md explains how the git hooks manage the plugin version.

Testing

  • bun run test: 559 pass
  • bun run test:smoke: 18 pass
  • bun run typecheck, bun run lint: clean

mindsocket and others added 5 commits October 7, 2026 10:28
…written

Load frontmatter and embedded YAML blocks with js-yaml's default schema minus
the timestamp type, replacing coerceDates. Datetimes are no longer truncated to
YYYY-MM-DD, offsets are kept, and dates inside lists are no longer left as Date
objects. Add a date-time format (ISO 8601 with offset) and document comparing
dates in rules with $toMillis().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e wiki

Schemas can now require a date, a datetime, or accept either. The knowledge
wiki's published_date and note date accept either rather than rejecting
datetimes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add schemas/_okf.json and schemas/okf.json so an OKF bundle validates as a
plain markdown space. Any concept type is accepted and unknown fields are
tolerated; provenance, trust, lifecycle and Attested Computation fields are
checked when present, with rules for description, stale_after ordering,
usage_count windows and computation presence. Reserved index.md and log.md
are reported as excluded during parsing.

Closes #143

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…date-time

- date, date-time and date-or-date-time reject impossible values (2026-02-30, 25:00)
- date-or-date-time accepts datetimes without seconds or offset, as Obsidian writes them
- dumpYaml writes Date values as ISO 8601 strings instead of throwing
- build YAML_SCHEMA by filtering the default schema's timestamp type
- document comparing dates with $toMillis() in filters, and its seconds requirement

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mindsocket mindsocket changed the title Keep frontmatter timestamps as written; bundle an OKF schema Keep frontmatter dates as written; bundle an OKF v0.2 schema Oct 7, 2026
Repository owner deleted a comment from claude Bot Oct 7, 2026
@claude

claude Bot commented Oct 7, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@mindsocket
mindsocket merged commit 9758d87 into main Oct 7, 2026
3 checks passed
@mindsocket
mindsocket deleted the feat/preserve-frontmatter-timestamps branch October 27, 2026 11:32
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.

Bundle an Open Knowledge Format (OKF) schema

1 participant