Skip to content

feat!: migrate ADRs to the Open Knowledge Format - #9

Merged
manuelmauro merged 3 commits into
mainfrom
feat/okf-migration
Jul 14, 2026
Merged

feat!: migrate ADRs to the Open Knowledge Format#9
manuelmauro merged 3 commits into
mainfrom
feat/okf-migration

Conversation

@manuelmauro

@manuelmauro manuelmauro commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Description

Migrates arkouda from its bespoke ADR frontmatter schema to the Open Knowledge Format (OKF) v0.1. An ADR directory becomes an OKF knowledge bundle; each ADR becomes a concept.

No backward compatibility is provided, as agreed. arkouda check fails loudly on the old schema — that's the intended way to find files to migrate.

Motivation

Arkouda's pitch is that ADRs should be machine-readable for AI agents. A schema only one tool can read is machine-readable in the weakest possible sense: an OKF-aware agent looks for type, finds nothing, and has to special-case arkouda.

OKF specifies almost exactly what arkouda already invented — a directory of Markdown files with YAML frontmatter, readable without tooling, diffable in git. Adopting it costs one constant field and buys interoperability. Arkouda is pre-1.0 and the old schema has no external consumers, so this is the cheapest moment to move.

The id key was already redundant: OKF defines a concept's id as its path within the bundle minus .md, and the validator's E005 existed only to police the fact that id duplicated the filename.

Rationale recorded in docs/adr/adopt-okf.md, using arkouda itself.

Changes

Frontmatter (BREAKING)

Before After Notes
type Required by OKF. Always Architecture Decision Record.
id removed Concept id is the bundle-relative path without .md.
abstract description OKF's name for a one-sentence summary.
date timestamp ISO 8601 date or datetime.
status, deciders, superseded_by unchanged Retained as OKF producer extensions (§4.1).

CLI (BREAKING)

  • arkouda new --abstract--description
  • arkouda list --sort date--sort timestamp; the -l table's third column is now the timestamp.

Structure

  • Discovery recurses into subdirectories: security/mtls.md is the concept security/mtls.
  • index.md and log.md are reserved (OKF §3.1) and are never treated as ADRs.

New: arkouda index

Generates the bundle-root index.md (OKF §6) — every concept grouped under its status heading with its one-line description, so an agent can read one file instead of opening five. It declares okf_version: "0.1", the one place OKF §11 permits frontmatter in an index. arkouda new refreshes an existing index but never creates one, since OKF §9 makes indexes optional.

Validation

OKF conformance (§9) is the floor; arkouda's ADR contract stacks on top. OKF's permissive-consumption rule decides what is a warning rather than an error — neither of the new warnings fails CI:

  • E005 now flags a type that isn't Architecture Decision Record (replacing the "stem must match id" check that removing id made vacuous).
  • E011 — an index.md carries frontmatter where OKF doesn't permit it.
  • E012 — a log.md heading isn't an ISO 8601 YYYY-MM-DD date.
  • E013 (warning) — the bundle declares an OKF version arkouda doesn't implement.
  • E014 (warning)index.md is stale; run arkouda index.

Also

  • Duplicate-concept-id detection (E010) now validates all configured bundles as one collection. Within a single bundle a concept id is its path, so it can never collide — a duplicate is only ever a cross-bundle problem. Covered by a new regression test.
  • arkouda index refuses to run against a single-file --dir rather than truncating the index to the one concept it loaded.
  • Diagnostics print [E001]: message instead of [E001] : message, and [E012] 3: message when a line number is present.
  • The repo's own four ADRs are migrated. Their bodies are left as written — they're historical records of what was decided at the time, and adopt-okf supersedes the frontmatter schema they describe.

Verification

Beyond cargo test --all (61 tests, up from 56), I drove the CLI end-to-end against scratch bundles to observe each behaviour:

  • old-schema ADR → E001 ×3, exit 1
  • new on a bundle with no index → no index created
  • new on a bundle with an index → index refreshed
  • nested security/mtls.md → discovered, indexed with a bundle-relative link, resolvable by decision security/mtls and decision mtls
  • stale index / unknown okf_version → warnings, exit 0
  • nested index.md with frontmatter → E011; non-ISO log.md heading → E012
  • index.md / log.md never appear in arkouda list
  • two bundles sharing use-postgresE010 on both, exit 1

Checklist

  • arkouda check passes
  • Tests pass (cargo test --all)
  • Documentation updated (README, skills/use-arkouda/SKILL.md, CHANGELOG.md, .arkoudarc.toml)

Summary by CodeRabbit

  • New Features

    • Added Open Knowledge Format (OKF) v0.1 support for ADR knowledge bundles.
    • Added recursive concept discovery and automatic bundle index generation via arkouda index.
    • Added validation diagnostics and warnings for bundle, index, and log files.
    • Added shell completion support through arkouda self completions.
  • Changed

    • Updated ADR metadata to use type, description, and timestamp.
    • Renamed --abstract to --description and --sort date to --sort timestamp.
    • Updated listing, validation, documentation, and examples for the new bundle workflow.

Store ADRs as an OKF v0.1 knowledge bundle instead of arkouda's bespoke
frontmatter schema, so any OKF-aware consumer can read them without
special-casing arkouda.

Frontmatter adopts OKF's vocabulary: a new required
`type: Architecture Decision Record`, `abstract` -> `description`, and
`date` -> `timestamp` (ISO 8601 date or datetime). `status`, `deciders`,
and `superseded_by` are retained as OKF producer extensions.

The `id` key is removed: OKF defines a concept's id as its path within
the bundle minus the `.md` suffix, which the validator already enforced
via "filename stem must match id". Discovery now recurses into
subdirectories, and `index.md` / `log.md` are reserved by OKF section 3.1
and never treated as ADRs.

Adds `arkouda index`, which generates the bundle-root `index.md` listing
every concept under its status heading for progressive disclosure. It
declares `okf_version: "0.1"`, the one place OKF permits frontmatter in
an index. `arkouda new` refreshes an existing index but never creates
one, since OKF makes indexes optional.

Validation stacks OKF conformance under arkouda's ADR contract. OKF's
permissive-consumption rule decides what is a warning rather than an
error: an unimplemented declared OKF version (E013) and a stale
`index.md` (E014) are reported but never fail the run.

BREAKING CHANGE: the ADR frontmatter schema, `arkouda new --abstract`
(now `--description`), and `arkouda list --sort date` (now
`--sort timestamp`) all change. No compatibility shim is provided;
`arkouda check` fails on the old schema, which is how you find the files
to migrate.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@manuelmauro, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5e4f94e6-2897-494b-a1ff-2acdb99c7d73

📥 Commits

Reviewing files that changed from the base of the PR and between 20e802a and cbcfe46.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • README.md
  • docs/okf/LICENSE.md
  • docs/okf/README.md
  • docs/okf/SPEC.md
  • skills/use-arkouda/SKILL.md
  • src/cli.rs
  • src/commands/new.rs
📝 Walkthrough

Walkthrough

Migrates ADRs to OKF v0.1 knowledge bundles, adding recursive concept discovery, revised metadata and validation, generated indexes, updated CLI commands, refreshed examples, and corresponding documentation.

Changes

OKF knowledge bundle migration

Layer / File(s) Summary
Concept metadata and discovery
src/adr/frontmatter.rs, src/adr/manifest.rs, src/adr/mod.rs, src/adr/discovery.rs
ADR frontmatter uses OKF fields, concept IDs derive from bundle-relative paths, and recursive discovery excludes hidden and reserved files.
Bundle loading and validation
src/commands/mod.rs, src/commands/check.rs, src/adr/validator.rs
Bundle-scoped loading validates concepts, reserved files, duplicate concept IDs, timestamps, required sections, and stale indexes with updated diagnostics.
Index generation and CLI integration
src/adr/index.rs, src/commands/index.rs, src/commands/new.rs, src/commands/list.rs, src/cli.rs, src/main.rs, src/error.rs, src/telemetry.rs
Adds index rendering and regeneration, changes --abstract to --description, replaces date sorting with timestamp sorting, and wires the new index command.
Documentation and repository contract
.arkoudarc.toml, README.md, CHANGELOG.md, docs/adr/*, skills/use-arkouda/SKILL.md
Documents OKF bundle layout, metadata migration, reserved files, diagnostics, revised commands, and updated ADR examples.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • manuelmauro/arkouda#2: Provides the telemetry feature whose command naming and argument-redaction behavior are updated here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: a breaking migration of ADRs to OKF.
Description check ✅ Passed The description includes all required sections and gives a detailed, relevant summary of the migration and checklist.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/okf-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 101: Update the fenced code block containing the bundle layout tree
diagram in the README to specify the text language, changing its opening fence
to ```text while preserving the diagram contents.

In `@skills/use-arkouda/SKILL.md`:
- Line 59: Update the `arkouda list -l` documentation to include the
`DESCRIPTION` column after `TITLE`, matching the actual `TITLE — DESCRIPTION`
output format.
- Line 202: The documentation incorrectly prohibits editing log.md; update the
guidance so only index.md is protected from manual edits, while clarifying that
log.md may be maintained by users but remains reserved from concept discovery
and subject to date-heading validation.
- Line 53: Update the ID terminology in the relevant SKILL.md references,
including the lines around the ADR filename guidance and the additional
occurrences, to describe IDs as bundle-relative paths without the .md suffix
rather than filename stems; retain examples such as security/mtls and ensure
superseded_by values and links use the full relative path.

In `@src/commands/new.rs`:
- Around line 50-73: Make index refresh best-effort after the ADR is created:
update the call to refresh_index in the creation flow to catch failures, emit a
clear warning unless quiet mode is enabled, and still return the successful exit
code. Keep refresh_index unchanged for successful updates, and reference its
existing Result error when reporting the warning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 51f86e82-0d78-47b0-80f5-de4aabfd2259

📥 Commits

Reviewing files that changed from the base of the PR and between 91c8702 and 20e802a.

📒 Files selected for processing (26)
  • .arkoudarc.toml
  • CHANGELOG.md
  • README.md
  • docs/adr/adopt-okf.md
  • docs/adr/basic-adr-cli.md
  • docs/adr/defer-to-unix-tools.md
  • docs/adr/index.md
  • docs/adr/ls-style-list-and-decision.md
  • docs/adr/telemetry-for-agent-command-invocations.md
  • skills/use-arkouda/SKILL.md
  • src/adr/discovery.rs
  • src/adr/frontmatter.rs
  • src/adr/index.rs
  • src/adr/manifest.rs
  • src/adr/mod.rs
  • src/adr/validator.rs
  • src/cli.rs
  • src/commands/check.rs
  • src/commands/decision.rs
  • src/commands/index.rs
  • src/commands/list.rs
  • src/commands/mod.rs
  • src/commands/new.rs
  • src/error.rs
  • src/main.rs
  • src/telemetry.rs

Comment thread README.md Outdated
Comment thread skills/use-arkouda/SKILL.md Outdated
Comment thread skills/use-arkouda/SKILL.md Outdated
Comment thread skills/use-arkouda/SKILL.md Outdated
Comment thread src/commands/new.rs Outdated
Refreshing a bundle's `index.md` re-parses every concept in it, so an
unrelated malformed ADR made `arkouda new` exit 1 after it had already
written the new file and printed success. A script checking the exit code
would treat a completed creation as a failure.

The refresh is now best-effort: it warns on stderr and the command exits
0. A stale index is only ever a warning (E014), and `arkouda check`
reports it.

Also correct the docs CodeRabbit flagged:

- A concept id is the bundle-relative path without `.md`, not the
  filename stem — `security/mtls.md` has the id `security/mtls`, so
  `superseded_by` values and links must carry the full path.
- `arkouda list -l` prints `TITLE — DESCRIPTION`; the documented column
  list stopped at `TITLE`.
- `log.md` is hand-maintained: arkouda never generates it, only validates
  its date headings. Only `index.md` must not be edited by hand.
- Tag the README bundle-layout code fence as `text` (markdownlint MD040).
@manuelmauro

Copy link
Copy Markdown
Owner Author

Addressed all five CodeRabbit comments in 7007b25.

src/commands/new.rsrefresh_index failure produces exit 1. Real, and reproduced: with a malformed sibling concept in the bundle, arkouda new wrote the file, printed ✓ Created ADR, then exited 1 because refreshing the index re-parses every concept. The refresh is now best-effort — it warns on stderr and the command exits 0. A stale index is only ever a warning (E014), so arkouda check is the thing that reports it. Locked with three tests: a_failed_index_refresh_does_not_fail_the_creation, creation_refreshes_an_existing_index, and creation_never_conjures_an_index.

skills/use-arkouda/SKILL.md — IDs described as filename stems. Correct catch, and it mattered more than the other doc nits: a concept id is the bundle-relative path minus .md, so a nested security/mtls.md has the id security/mtls, not mtls. Writing superseded_by: mtls would have dangled. Fixed at all three sites, and the supersede workflow now says to use the full concept id.

skills/use-arkouda/SKILL.mdlist -l column list. Fixed to ID STATUS TIMESTAMP PATH TITLE — DESCRIPTION, verified against actual output. Also corrected the same claim in README.md and in the --help text on ListArgs, which had the same gap.

skills/use-arkouda/SKILL.md — do not prohibit editing log.md. Right, and my wording left no supported way to maintain a log at all. arkouda index generates only index.md; log.md is hand-maintained and merely validated for ## YYYY-MM-DD headings. Reworded so only index.md is off-limits.

README.md — untagged code fence (MD040). Tagged as text. Swept the other changed Markdown for the same issue; no further violations.

make ci is green: fmt, clippy -D warnings, 64 tests (up from 61), build, and arkouda check.

@manuelmauro

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 24 minutes.

Add a verbatim copy of the Open Knowledge Format specification arkouda
implements, so the exact text it was built against is pinned in-tree,
readable offline, and diffable when upstream moves.

`docs/okf/SPEC.md` and `docs/okf/LICENSE.md` are byte-for-byte copies of
upstream `okf/SPEC.md` and `okf/LICENSE.md` at commit ee67a5ca. Neither is
modified. The spec is Apache 2.0, so its licence travels with it; upstream
ships no NOTICE file, and the spec carries no copyright header of its own.

`docs/okf/README.md` is arkouda's own provenance note — upstream commit,
retrieval date, SHA-256 checksums, a verified refresh procedure, and a map
from the spec's sections to the code that implements them. It is flagged
as not-upstream, since upstream has a different `okf/README.md` that is
deliberately not vendored.

`docs/okf/` is outside the `dirs` in `.arkoudarc.toml`, so `arkouda check`
does not treat the vendored Markdown as ADR concepts.
@manuelmauro
manuelmauro merged commit e38166d into main Jul 14, 2026
2 checks passed
@manuelmauro
manuelmauro deleted the feat/okf-migration branch July 14, 2026 10:02
@manuelmauro manuelmauro mentioned this pull request Jul 14, 2026
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.

1 participant