feat(cli): --base-ns and --timestamp flags on knot/episode/retract (#28, #27)#34
Merged
Conversation
…, #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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onepisode.--base-ns <IRI>onepisode(#28)episodeminted 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-Turtleknotpath.episodenow accepts--base-ns, defaulting toDEFAULT_BASE_NS.Not added to
knot:knotingests verbatim RDF, so a base-ns override is a genuine no-op there (theingest_rdfbase_iriarg is for relative-IRI resolution, a different concept). Adding it would be misleading.--timestamp <ISO-8601>onknot/episode/retract(#27)These hardcoded
now()forvalid_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_iso8601shape check rejects obviously-malformed values before they corruptvalid_from— deliberately not a full parse, since the CLI carries no chrono dependency.Refactor
Factors the repeated
--flag valueidiom (--shapes,--predicate, …) intoflag_value(), plusresolve_timestamp().Verification
Unit tests for
flag_value/resolve_timestamp/looks_like_iso8601, and end-to-end:--timestamp 2020-01-01…drivesvalid_from:query --valid-at 2019…→ 0 results,--valid-at 2021…→ 1 result.episode --base-ns https://quarterdeck.internal/ontology#mints IRIs in that namespace.--timestamp 2026/07/13is 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