Skip to content

feat(cli): --base-ns and --timestamp flags on knot/episode/retract (#28, #27)#34

Merged
scbrown merged 2 commits into
mainfrom
feat/cli-base-ns-and-timestamp
Jul 14, 2026
Merged

feat(cli): --base-ns and --timestamp flags on knot/episode/retract (#28, #27)#34
scbrown merged 2 commits into
mainfrom
feat/cli-base-ns-and-timestamp

Conversation

@scbrown

@scbrown scbrown commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #28 and #27. Both expose library capabilities the CLI hid behind hardcoded defaults — no library change. Grouped in one PR because they touch the same three commands (cmd_knot, cmd_episode, cmd_retract) and overlap heavily on episode.

--base-ns <IRI> on episode (#28)

episode minted IRIs in the fixed aegis namespace (DEFAULT_BASE_NS), so a non-aegis deployment couldn't use the validation-carrying episode abstraction — it was forced onto the verbatim-Turtle knot path. episode now accepts --base-ns, defaulting to DEFAULT_BASE_NS.

Not added to knot: knot ingests verbatim RDF, so a base-ns override is a genuine no-op there (the ingest_rdf base_iri arg is for relative-IRI resolution, a different concept). Adding it would be misleading.

--timestamp <ISO-8601> on knot / episode / retract (#27)

These hardcoded now() for valid_from, recording only transaction-time. When ingesting from a system-of-record (beads, PRs, commits) the meaningful valid-time is the source event time. All three now accept --timestamp, defaulting to now. Fully backward-compatible.

A lightweight looks_like_iso8601 shape check rejects obviously-malformed values before they corrupt valid_from — deliberately not a full parse, since the CLI carries no chrono dependency.

Refactor

Factors the repeated --flag value idiom (--shapes, --predicate, …) into flag_value(), plus resolve_timestamp().

Verification

Unit tests for flag_value / resolve_timestamp / looks_like_iso8601, and end-to-end:

  • Supplied --timestamp 2020-01-01… drives valid_from: query --valid-at 2019… → 0 results, --valid-at 2021… → 1 result.
  • episode --base-ns https://quarterdeck.internal/ontology# mints IRIs in that namespace.
  • Malformed --timestamp 2026/07/13 is rejected with a clear error.

Full suite: 352 passed. Clippy clean on both CI matrix configs (--no-default-features, --features shacl, -D warnings -A missing-docs).

🤖 Generated with Claude Code

scbrown and others added 2 commits July 13, 2026 21:48
…, #27)

Both flags expose library capabilities the CLI layer previously hid behind
hardcoded defaults; no library change.

--base-ns (#28): `episode` minted IRIs in the fixed aegis namespace, forcing
non-aegis deployments to route around the (validation-carrying) episode
abstraction via verbatim-Turtle knot. `episode` now takes `--base-ns <IRI>`,
defaulting to DEFAULT_BASE_NS. (Not added to `knot`: it ingests verbatim, so
base-ns is a genuine no-op there.)

--timestamp (#27): `knot`, `episode`, and `retract` hardcoded now() for
valid_from, recording only transaction-time. When ingesting from a
system-of-record the meaningful valid-time is the source event time. All three
now accept `--timestamp <ISO-8601>`, defaulting to now. A lightweight shape
check rejects obviously-malformed values before they reach valid_from (the CLI
carries no chrono dep, so it is not a full parse).

Factors the repeated `--flag value` idiom into `flag_value()` and adds
`resolve_timestamp()`. Tested end-to-end: a supplied --timestamp drives
valid_from (temporal query returns 0 before / 1 after), and --base-ns mints
IRIs in the given namespace.

Closes #28
Closes #27

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VsuPDxSUjMYqHvQyPvSAPW
Satisfies the fmt gate (cargo fmt --check / pre-commit cargo-fmt hook);
no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VsuPDxSUjMYqHvQyPvSAPW
@scbrown
scbrown merged commit 3230d4f into main Jul 14, 2026
10 checks passed
@scbrown
scbrown deleted the feat/cli-base-ns-and-timestamp branch July 14, 2026 02:26
scbrown added a commit that referenced this pull request Jul 14, 2026
Louvain community detection (#31), live graph report + quipu_report tool (#32),
episode-scoped retraction (#33), and --base-ns/--timestamp CLI flags (#34).

Manual release: release-plz's release-pr step is blocked by the repo's
"Actions may not create PRs" setting (403); cutting the tag + GitHub release by
hand per the established fallback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VsuPDxSUjMYqHvQyPvSAPW
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.

feat(cli): add --base-ns flag to override hardcoded aegis namespace on episode

1 participant