Skip to content

chore(knowledge): migrate specs to OKF#2202

Merged
chaliy merged 2 commits into
mainfrom
ok-nice-ship-e7ad0f7c
Jul 25, 2026
Merged

chore(knowledge): migrate specs to OKF#2202
chaliy merged 2 commits into
mainfrom
ok-nice-ship-e7ad0f7c

Conversation

@chaliy

@chaliy chaliy commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What

  • migrate the canonical specs/ corpus to an Open Knowledge Format bundle under knowledge/
  • add OKF metadata, bundle indexes, and a durable agent maintenance contract
  • update repository workflows, links, packaging paths, and generated-status references

Why

Bashkit needs one persistent, agent-maintained knowledge base that captures architecture, behavior, constraints, threats, tests, and operational decisions while preserving the automatic-update properties of the former specifications.

How

  • preserved document history through Git renames
  • added title and summary frontmatter to each knowledge document
  • made knowledge/index.md the canonical map and maintenance contract
  • kept generated builtin inventory under an indexed knowledge/status/ collection

Before / After

Before: durable engineering memory lived in specs/ without an OKF bundle index or explicit knowledge-maintenance contract.

After: knowledge/ is a valid indexed OKF bundle, and agent/contributor workflows require synchronized updates when implementation facts change.

Testing

  • just pre-pr
  • migration-specific OKF metadata and collection-index validation
  • local Markdown link validation
  • generated builtin inventory regeneration/hash stability check

Produced by yolop

Co-Authored-By: yolop <yolop@everruns.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 25, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit fb5f417 Commit Preview URL

Branch Preview URL
Jul 25 2026, 05:11 AM

Co-Authored-By: yolop <yolop@everruns.com>
@chaliy
chaliy merged commit cc75ac2 into main Jul 25, 2026
46 checks passed
@chaliy
chaliy deleted the ok-nice-ship-e7ad0f7c branch July 25, 2026 05:22
chaliy added a commit that referenced this pull request Jul 26, 2026
…ant (#2206)

## What changed

The `specs/` → `knowledge/` migration (#2202) adopted OKF in name only.
This makes the bundle conform to [OKF
v0.2](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md)
and adds a gate so it stays that way.

Four spec violations, every one of which made the bundle non-conformant:

| Violation | Spec | Fix |
|---|---|---|
| No `type` on any concept — the **only** always-required key, so *zero*
documents conformed | §4.1, §11 | `type` on all 31 concepts |
| `summary:` — not an OKF field | §4.1 | renamed to `description:` |
| Both `index.md` files carried `title`/`summary`/`tags` frontmatter |
§8 — index files carry no frontmatter; root may carry only `okf_version`
| stripped; root declares `okf_version: "0.2"` |
| Index bodies were prose + a table, not directory listings | §8 — `*
[Title](url) - description` sections | reshaped |

Alongside that:

- Maintenance rules moved out of `index.md` (prose does not belong in a
reserved index) into `knowledge/knowledge-contract.md`, which also
records the OKF rules and the type vocabulary. `AGENTS.md` points there.
- `knowledge/status/builtins.json` was an unreferenced blob; it is now
described by a `Generated Inventory` concept with `resource:` pointing
at it.
- Added `knowledge/log.md` (§9 date-grouped history).

Enforcement is two checks that cover different things:

- **`okf-lint` 0.1.1** (crates.io, pinned) — upstream spec gate. It
enforces the reserved `index.md`/`log.md` structures and cites the spec
section in every diagnostic.
- **`scripts/check_okf.py`** — no dependencies, covers the bundle-local
conventions okf-lint does not: `description` (not `summary`), and every
concept listed in its directory's `index.md`.

Both run in the CI lint job and in `just check-okf` (wired into `just
check`).

## Why

An OKF bundle that no OKF consumer would accept is worse than not
claiming the format: agents and tooling route on `type`, and every
document was missing it. Nothing validated the bundle, so the defects
shipped silently.

## Before / After

Conformance, checked with the upstream linter:

```console
# before
$ okf-lint knowledge --max-line-length 10000
index.md:1: root index.md frontmatter may only contain 'okf_version' (spec: …#6-index-files)
architecture.md:1: frontmatter missing required non-empty 'type' field (spec: …#4.1-frontmatter)
… 31 concepts, all missing 'type'
exit=1

# after
$ just check-okf
knowledge: OKF v0.2 conformant (31 concepts, 2 index files, 1 log file)
okf-lint 0.1.1: knowledge conforms to OKF v0.2
exit=0
```

Four OKF implementations were built and run against the bundle and
against a fixture per regression class, to pick the gate. `fail` =
regression caught, `pass` = slipped through:

| Regression | `okf` | `okftool` | `okf-lint` | `check_okf.py` |
|---|---|---|---|---|
| Concept missing `type` | fail | fail | fail | fail |
| `summary` instead of `description` | pass | pass | pass | fail |
| Frontmatter on `index.md` | pass | pass | fail | fail |
| Concept absent from `index.md` | pass | pass | pass | fail |
| `log.md` heading not `YYYY-MM-DD` | pass | pass | fail | fail |

`okf-lint` is the strongest available and is adopted. It does not
subsume the local check: the two rows it lets through are bundle-local
conventions, and the first is exactly the defect #2202 shipped. The
rejected alternatives are recorded with rationale in
`knowledge/knowledge-contract.md` — `okftool` treats everything but
`type` as advisory, `okf` implements OKF **v0.1** (wrong revision for
this bundle), and `okflint` validates against a hand-authored manifest
rather than the spec and needs Python 3.12+ against this repo's 3.9
floor.

No runtime behavior changes: no `.rs` files are touched. `just pre-pr`
green, including `cargo vet`.

## Risk

- **Low**
- Documentation and CI only — no library, CLI, or binding code changes.
- New CI dependency: `cargo install okf-lint --version 0.1.1 --locked`
in the lint job. It is a lint tool, not a workspace dependency, so
`deny.toml`/`cargo vet` are unaffected. Failure mode is a red lint job;
removing the two lines reverts it. The version is pinned in both
`ci.yml` and the `justfile` and must be bumped together.
- `--max-line-length 10000` effectively disables okf-lint's line-length
rule; knowledge docs wrap prose at author discretion, and the rule
otherwise fires 183 times.

## Checklist

- [x] Tests added or updated — `scripts/tests/test_check_okf.py`, one
case per rejection class plus a positive control, as `unittest.TestCase`
so `unittest discover` actually executes them
- [x] Backward compatibility considered — internal knowledge/tooling
only; no public surface

---
_Generated by [Claude
Code](https://claude.ai/code/session_01VydQA3PQfm442uwHSTrZnN)_
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