okf-cli 0.6.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- okf_cli-0.7.0/.last-update.json +1 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/AGENTS.md +6 -6
- {okf_cli-0.6.0 → okf_cli-0.7.0}/PKG-INFO +3 -3
- {okf_cli-0.6.0 → okf_cli-0.7.0}/README.md +1 -1
- {okf_cli-0.6.0 → okf_cli-0.7.0}/pyproject.toml +1 -1
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/api.py +59 -5
- {okf_cli-0.6.0 → okf_cli-0.7.0}/tests/test_api.py +131 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/uv.lock +1 -1
- {okf_cli-0.6.0/openwiki → okf_cli-0.7.0/wiki}/architecture.md +1 -1
- {okf_cli-0.6.0/openwiki → okf_cli-0.7.0/wiki}/quickstart.md +3 -3
- {okf_cli-0.6.0/openwiki → okf_cli-0.7.0/wiki}/testing.md +5 -4
- okf_cli-0.6.0/.last-update.json +0 -1
- {okf_cli-0.6.0 → okf_cli-0.7.0}/.github/workflows/test.yml +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/.gitignore +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/LICENSE +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/SPEC/OKF_SPEC_V0_1.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/SPEC/OKF_SPEC_V0_2.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/.okfignore +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/README.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/blank-line/no-blank.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/blank-line/with-blank.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/computations/revenue.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/datasets/sales.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/domain.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/loose/deep/no-heading.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/loose/no-desc.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/loose/no-title.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/metrics/income-statement.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/playbooks/incident-response.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/playbooks/oncall-guide.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/references/revenue-recognition.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/smoke-ignore.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/tables/customers.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/tables/orders.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/tables/partitions/2026/q1/jan/january.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/example/tables/partitions/daily.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/skills/okf-cli/SKILL.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/skills/writing-knowledge-base/SKILL.md +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/__init__.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/cli.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/commands/__init__.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/commands/bundle.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/commands/list.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/commands/read.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/commands/validate.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/src/okf/core.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/tests/test_cli.py +0 -0
- {okf_cli-0.6.0 → okf_cli-0.7.0}/tests/test_core.py +0 -0
- {okf_cli-0.6.0/openwiki → okf_cli-0.7.0/wiki}/domain-model.md +0 -0
- {okf_cli-0.6.0/openwiki → okf_cli-0.7.0/wiki}/operations.md +0 -0
- {okf_cli-0.6.0/openwiki → okf_cli-0.7.0/wiki}/workflows.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"head": "c5781415bec2d85faf741ccf92f5ab5d56448879", "timestamp": "2026-08-13T06:01:33Z"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# AGENTS.md — okf-cli contributor context
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Wiki
|
|
4
4
|
|
|
5
|
-
This repository has documentation located in the /
|
|
5
|
+
This repository has documentation located in the /wiki directory.
|
|
6
6
|
|
|
7
7
|
Start here:
|
|
8
8
|
|
|
9
|
-
- [
|
|
9
|
+
- [Wiki quickstart](wiki/quickstart.md)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Wiki includes repository overview, architecture notes, workflows, domain concepts, operations, integrations, testing guidance, and source maps.
|
|
12
12
|
|
|
13
|
-
When working in this repository, read the
|
|
13
|
+
When working in this repository, read the Wiki quickstart first, then follow its links to the relevant architecture, workflow, domain, operation, and testing notes.
|
|
14
14
|
|
|
15
15
|
## Tech stack
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@ Python 3.11+, **uv**, **typer**, **pyyaml**, **rich**, **pytest**, **ruff**, **h
|
|
|
23
23
|
- `src/okf/core.py` — shared parsing, formatting, and conformance helpers
|
|
24
24
|
- `src/okf/commands/` — thin CLI wrappers (`bundle`, `list`, `read`, `validate`)
|
|
25
25
|
- `tests/` — `test_api.py`, `test_cli.py`, `test_core.py`
|
|
26
|
-
- `
|
|
26
|
+
- `wiki/` — architecture, workflows, domain model, operations, testing notes
|
|
27
27
|
- `.github/workflows/test.yml` — CI (pytest + ruff on Python 3.11)
|
|
28
28
|
|
|
29
29
|
## Common tasks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: okf-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Open Knowledge Format tooling
|
|
5
5
|
License: MIT License
|
|
6
6
|
|
|
@@ -70,6 +70,6 @@ uv run okf read example_knowledge_base tables/customers
|
|
|
70
70
|
|
|
71
71
|
## Documentation
|
|
72
72
|
|
|
73
|
-
- Detailed user and contributor docs: [
|
|
73
|
+
- Detailed user and contributor docs: [wiki/quickstart.md](wiki/quickstart.md)
|
|
74
74
|
- Agent contributor context: [AGENTS.md](AGENTS.md)
|
|
75
75
|
- OKF v0.2 specification: [SPEC/OKF_SPEC_V0_2.md](SPEC/OKF_SPEC_V0_2.md)
|
|
@@ -38,6 +38,6 @@ uv run okf read example_knowledge_base tables/customers
|
|
|
38
38
|
|
|
39
39
|
## Documentation
|
|
40
40
|
|
|
41
|
-
- Detailed user and contributor docs: [
|
|
41
|
+
- Detailed user and contributor docs: [wiki/quickstart.md](wiki/quickstart.md)
|
|
42
42
|
- Agent contributor context: [AGENTS.md](AGENTS.md)
|
|
43
43
|
- OKF v0.2 specification: [SPEC/OKF_SPEC_V0_2.md](SPEC/OKF_SPEC_V0_2.md)
|
|
@@ -129,14 +129,34 @@ def _load_okfignore(src: Path) -> set[str]:
|
|
|
129
129
|
line = raw.strip()
|
|
130
130
|
if not line or line.startswith("#"):
|
|
131
131
|
continue
|
|
132
|
-
|
|
132
|
+
entry = line.lstrip("./")
|
|
133
|
+
# Normalize folder globs: tables/foo/*, tables/foo/** -> tables/foo/
|
|
134
|
+
if entry.endswith("/**"):
|
|
135
|
+
entry = entry[:-3] + "/"
|
|
136
|
+
elif entry.endswith("/*"):
|
|
137
|
+
entry = entry[:-2] + "/"
|
|
138
|
+
entries.add(entry)
|
|
133
139
|
return entries
|
|
134
140
|
|
|
135
141
|
|
|
136
|
-
def
|
|
137
|
-
"""
|
|
142
|
+
def _is_ignored(rel_posix: str, ignored: set[str]) -> bool:
|
|
143
|
+
"""Check exact match or folder-prefix match (entries ending with /)."""
|
|
144
|
+
if rel_posix in ignored:
|
|
145
|
+
return True
|
|
146
|
+
return any(pat.endswith("/") and rel_posix.startswith(pat) for pat in ignored)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _generate_indexes(
|
|
150
|
+
processed: list[tuple[Path, dict]], dst: Path, *, overwrite: bool = False
|
|
151
|
+
) -> int:
|
|
152
|
+
"""Generate index.md for every directory with concept files or subdirs.
|
|
153
|
+
|
|
154
|
+
Returns the number of index files written. Existing index files are kept
|
|
155
|
+
unless ``overwrite`` is true.
|
|
156
|
+
"""
|
|
138
157
|
dir_files: dict[Path, list[dict]] = {}
|
|
139
158
|
dir_subdirs: dict[Path, set[str]] = {}
|
|
159
|
+
written = 0
|
|
140
160
|
|
|
141
161
|
for rel, meta in processed:
|
|
142
162
|
parent = rel.parent
|
|
@@ -154,7 +174,7 @@ def _generate_indexes(processed: list[tuple[Path, dict]], dst: Path) -> None:
|
|
|
154
174
|
|
|
155
175
|
for dir_path in sorted(set(dir_files.keys()) | set(dir_subdirs.keys())):
|
|
156
176
|
index_path = dst / dir_path / "index.md"
|
|
157
|
-
if index_path.exists():
|
|
177
|
+
if index_path.exists() and not overwrite:
|
|
158
178
|
continue
|
|
159
179
|
|
|
160
180
|
lines: list[str] = []
|
|
@@ -186,6 +206,9 @@ def _generate_indexes(processed: list[tuple[Path, dict]], dst: Path) -> None:
|
|
|
186
206
|
if lines:
|
|
187
207
|
index_path.parent.mkdir(parents=True, exist_ok=True)
|
|
188
208
|
index_path.write_text("\n".join(lines), encoding="utf-8")
|
|
209
|
+
written += 1
|
|
210
|
+
|
|
211
|
+
return written
|
|
189
212
|
|
|
190
213
|
|
|
191
214
|
# ---------------------------------------------------------------------------
|
|
@@ -383,7 +406,7 @@ def bundle(
|
|
|
383
406
|
rel = f.relative_to(src)
|
|
384
407
|
rel_posix = rel.as_posix()
|
|
385
408
|
|
|
386
|
-
if rel_posix
|
|
409
|
+
if _is_ignored(rel_posix, ignored):
|
|
387
410
|
warnings.append(f"Skipping {rel} — matched .okfignore")
|
|
388
411
|
continue
|
|
389
412
|
if f.name.lower() in RESERVED:
|
|
@@ -522,6 +545,37 @@ def bundle(
|
|
|
522
545
|
)
|
|
523
546
|
|
|
524
547
|
|
|
548
|
+
def reindex(bundle_dir: str | Path) -> BundleResult:
|
|
549
|
+
"""Rebuild every index.md in a bundle from the concept files on disk.
|
|
550
|
+
|
|
551
|
+
Args:
|
|
552
|
+
bundle_dir: Path to an OKF bundle directory.
|
|
553
|
+
|
|
554
|
+
Returns:
|
|
555
|
+
BundleResult with ``files_written`` set to the number of index files
|
|
556
|
+
written and ``output_dir`` set to ``bundle_dir``.
|
|
557
|
+
|
|
558
|
+
Raises:
|
|
559
|
+
NotADirectoryError: If bundle_dir is not a directory.
|
|
560
|
+
ValueError: If the directory is not a conformant OKF bundle.
|
|
561
|
+
"""
|
|
562
|
+
dst = Path(bundle_dir)
|
|
563
|
+
entries = list_entries(dst)
|
|
564
|
+
processed = [
|
|
565
|
+
(
|
|
566
|
+
Path(e["id"] + ".md"),
|
|
567
|
+
{
|
|
568
|
+
"title": e["title"],
|
|
569
|
+
"description": e["description"],
|
|
570
|
+
"type": e["type"],
|
|
571
|
+
},
|
|
572
|
+
)
|
|
573
|
+
for e in entries
|
|
574
|
+
]
|
|
575
|
+
count = _generate_indexes(processed, dst, overwrite=True)
|
|
576
|
+
return BundleResult(files_written=count, output_dir=dst)
|
|
577
|
+
|
|
578
|
+
|
|
525
579
|
def _iter_concept_files(dir_path: Path):
|
|
526
580
|
"""Yield (concept_id, file_path) for every concept in a bundle.
|
|
527
581
|
|
|
@@ -14,6 +14,7 @@ from okf.api import (
|
|
|
14
14
|
convert_file,
|
|
15
15
|
list_concepts,
|
|
16
16
|
list_entries,
|
|
17
|
+
reindex,
|
|
17
18
|
show_concept,
|
|
18
19
|
validate,
|
|
19
20
|
)
|
|
@@ -1296,6 +1297,136 @@ class TestValidate:
|
|
|
1296
1297
|
assert len(result.errors) == 2
|
|
1297
1298
|
|
|
1298
1299
|
|
|
1300
|
+
# ---------------------------------------------------------------------------
|
|
1301
|
+
# reindex()
|
|
1302
|
+
# ---------------------------------------------------------------------------
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
class TestReindex:
|
|
1306
|
+
def test_updates_stale_root_index(self, tmp_path: Path):
|
|
1307
|
+
src = tmp_path / "src"
|
|
1308
|
+
dst = tmp_path / "out"
|
|
1309
|
+
src.mkdir()
|
|
1310
|
+
_write(src, {"tables/orders.md": "# Orders\n\n> One row.\n\nBody."})
|
|
1311
|
+
bundle(src, dst)
|
|
1312
|
+
convert_content(
|
|
1313
|
+
"# Fresh Concept\n\n> New root concept.\n\nBody.",
|
|
1314
|
+
dst / "fresh.md",
|
|
1315
|
+
type_="reference",
|
|
1316
|
+
)
|
|
1317
|
+
assert "Fresh Concept" not in (dst / "index.md").read_text()
|
|
1318
|
+
|
|
1319
|
+
result = reindex(dst)
|
|
1320
|
+
|
|
1321
|
+
assert isinstance(result, BundleResult)
|
|
1322
|
+
assert result.output_dir == dst
|
|
1323
|
+
assert "[Fresh Concept](fresh.md)" in (dst / "index.md").read_text()
|
|
1324
|
+
|
|
1325
|
+
def test_updates_subdir_index(self, tmp_path: Path):
|
|
1326
|
+
src = tmp_path / "src"
|
|
1327
|
+
dst = tmp_path / "out"
|
|
1328
|
+
src.mkdir()
|
|
1329
|
+
_write(src, {"tables/orders.md": "# Orders\n\n> One row.\n\nBody."})
|
|
1330
|
+
bundle(src, dst)
|
|
1331
|
+
convert_content(
|
|
1332
|
+
"# Extra\n\n> Extra table.\n\nBody.",
|
|
1333
|
+
dst / "tables" / "extra.md",
|
|
1334
|
+
type_="tables",
|
|
1335
|
+
)
|
|
1336
|
+
|
|
1337
|
+
reindex(dst)
|
|
1338
|
+
|
|
1339
|
+
assert "[Extra](extra.md)" in (dst / "tables" / "index.md").read_text()
|
|
1340
|
+
|
|
1341
|
+
def test_adds_subdir_to_root_index(self, tmp_path: Path):
|
|
1342
|
+
src = tmp_path / "src"
|
|
1343
|
+
dst = tmp_path / "out"
|
|
1344
|
+
src.mkdir()
|
|
1345
|
+
_write(src, {"tables/orders.md": "# Orders\n\n> One row.\n\nBody."})
|
|
1346
|
+
bundle(src, dst)
|
|
1347
|
+
convert_content(
|
|
1348
|
+
"# Q1\n\n> First quarter.\n\nBody.",
|
|
1349
|
+
dst / "reports" / "q1.md",
|
|
1350
|
+
type_="reports",
|
|
1351
|
+
)
|
|
1352
|
+
|
|
1353
|
+
reindex(dst)
|
|
1354
|
+
|
|
1355
|
+
assert "[reports](reports/)" in (dst / "index.md").read_text()
|
|
1356
|
+
|
|
1357
|
+
def test_idempotent(self, tmp_path: Path):
|
|
1358
|
+
src = tmp_path / "src"
|
|
1359
|
+
dst = tmp_path / "out"
|
|
1360
|
+
src.mkdir()
|
|
1361
|
+
_write(
|
|
1362
|
+
src,
|
|
1363
|
+
{
|
|
1364
|
+
"tables/orders.md": "# Orders\n\n> One row.\n\nBody.",
|
|
1365
|
+
"root.md": "# Root\n\n> Root concept.\n\nBody.",
|
|
1366
|
+
},
|
|
1367
|
+
)
|
|
1368
|
+
bundle(src, dst)
|
|
1369
|
+
|
|
1370
|
+
first = reindex(dst)
|
|
1371
|
+
root_first = (dst / "index.md").read_text()
|
|
1372
|
+
sub_first = (dst / "tables" / "index.md").read_text()
|
|
1373
|
+
|
|
1374
|
+
second = reindex(dst)
|
|
1375
|
+
|
|
1376
|
+
assert first.files_written == second.files_written
|
|
1377
|
+
assert (dst / "index.md").read_text() == root_first
|
|
1378
|
+
assert (dst / "tables" / "index.md").read_text() == sub_first
|
|
1379
|
+
|
|
1380
|
+
def test_keeps_root_okf_version(self, tmp_path: Path):
|
|
1381
|
+
src = tmp_path / "src"
|
|
1382
|
+
dst = tmp_path / "out"
|
|
1383
|
+
src.mkdir()
|
|
1384
|
+
_write(src, {"tables/a.md": "# A\n\n> Desc.\n"})
|
|
1385
|
+
bundle(src, dst)
|
|
1386
|
+
|
|
1387
|
+
reindex(dst)
|
|
1388
|
+
|
|
1389
|
+
assert _read_frontmatter(dst / "index.md") == {"okf_version": "0.2"}
|
|
1390
|
+
|
|
1391
|
+
def test_passes_validate(self, tmp_path: Path):
|
|
1392
|
+
src = tmp_path / "src"
|
|
1393
|
+
dst = tmp_path / "out"
|
|
1394
|
+
src.mkdir()
|
|
1395
|
+
_write(src, {"tables/orders.md": "# Orders\n\n> One row.\n\nBody."})
|
|
1396
|
+
bundle(src, dst)
|
|
1397
|
+
convert_content(
|
|
1398
|
+
"# Fresh\n\n> New.\n\nBody.", dst / "tables" / "fresh.md", type_="tables"
|
|
1399
|
+
)
|
|
1400
|
+
|
|
1401
|
+
reindex(dst)
|
|
1402
|
+
|
|
1403
|
+
assert validate(dst).ok
|
|
1404
|
+
|
|
1405
|
+
def test_rejects_non_conformant_bundle(self, tmp_path: Path):
|
|
1406
|
+
d = tmp_path / "raw"
|
|
1407
|
+
d.mkdir()
|
|
1408
|
+
_write(d, {"plain.md": "# Title\n\n> Desc.\n\nBody."})
|
|
1409
|
+
|
|
1410
|
+
with pytest.raises(ValueError, match="not an OKF-conformant"):
|
|
1411
|
+
reindex(d)
|
|
1412
|
+
|
|
1413
|
+
def test_files_written_count(self, tmp_path: Path):
|
|
1414
|
+
src = tmp_path / "src"
|
|
1415
|
+
dst = tmp_path / "out"
|
|
1416
|
+
src.mkdir()
|
|
1417
|
+
_write(src, {"tables/a.md": "# A\n\n> Desc.\n"})
|
|
1418
|
+
bundle(src, dst)
|
|
1419
|
+
|
|
1420
|
+
result = reindex(dst)
|
|
1421
|
+
|
|
1422
|
+
# Root index plus one subdirectory index.
|
|
1423
|
+
assert result.files_written == 2
|
|
1424
|
+
|
|
1425
|
+
def test_not_a_dir(self, tmp_path: Path):
|
|
1426
|
+
with pytest.raises(NotADirectoryError):
|
|
1427
|
+
reindex(tmp_path / "nope")
|
|
1428
|
+
|
|
1429
|
+
|
|
1299
1430
|
# ---------------------------------------------------------------------------
|
|
1300
1431
|
# cross-command: bundle → validate/list/show
|
|
1301
1432
|
# ---------------------------------------------------------------------------
|
|
@@ -27,7 +27,7 @@ Public functions and return types:
|
|
|
27
27
|
| `show_concept(bundle_dir, concept_id)` | `ConceptContent` | Conformance-gated concept read with path traversal guard |
|
|
28
28
|
| `validate(bundle_dir)` | `ValidateResult` | Conformance check with `.ok` property |
|
|
29
29
|
|
|
30
|
-
Internal helpers (not public API): `_iter_links`, `_resolve_md_target`, `_load_okfignore`, `_generate_indexes`, `_write_concept`.
|
|
30
|
+
Internal helpers (not public API): `_iter_links`, `_resolve_md_target`, `_load_okfignore`, `_generate_indexes`, `_merge_input_frontmatter`, `_write_concept`.
|
|
31
31
|
|
|
32
32
|
### `src/okf/core.py` — shared utilities
|
|
33
33
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# okf-cli
|
|
1
|
+
# okf-cli Wiki quickstart
|
|
2
2
|
|
|
3
3
|
`okf-cli` converts plain markdown directories into Open Knowledge Format (OKF) bundles, then validates and reads those bundles.
|
|
4
4
|
|
|
@@ -58,7 +58,7 @@ Why this sequence:
|
|
|
58
58
|
1. `--strict` catches broken local `.md` references at bundle time and skips `AGENTS.md` generation.
|
|
59
59
|
1. `--dry-run` validates the source and reports warnings/errors without writing any files.
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Wiki map
|
|
62
62
|
|
|
63
63
|
- [Architecture](architecture.md) — runtime shape, command wiring, extension points.
|
|
64
64
|
- [Workflows](workflows.md) — day-to-day CLI and contributor workflows.
|
|
@@ -70,4 +70,4 @@ Why this sequence:
|
|
|
70
70
|
|
|
71
71
|
- Add/modify CLI behavior: start at [Architecture](architecture.md), then [Testing](testing.md).
|
|
72
72
|
- Change format/conformance rules: start at [Domain model](domain-model.md), then `src/okf/core.py` + validate/list/show tests.
|
|
73
|
-
- Update docs/user guidance: check `README.md` and align with this
|
|
73
|
+
- Update docs/user guidance: check `README.md` and align with this Wiki.
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
## Test suite map
|
|
4
4
|
|
|
5
5
|
- API unit/integration tests: `tests/test_api.py`
|
|
6
|
-
- `TestBundle` — bundling via `api.bundle()`, link checking, `.okfignore`, lenient parsing, `AGENTS.md` generation
|
|
6
|
+
- `TestBundle` — bundling via `api.bundle()`, input frontmatter merging, link checking, `.okfignore`, lenient parsing, `AGENTS.md` generation
|
|
7
7
|
- `TestListConcepts` — listing via `api.list_concepts()`, reserved file handling
|
|
8
8
|
- `TestListEntries` — listing metadata via `api.list_entries()` (ID, type, title, description)
|
|
9
9
|
- `TestShowConcept` — reading via `api.show_concept()`, path traversal guard
|
|
10
10
|
- `TestValidate` — conformance checks via `api.validate()`, all §11 rule variants
|
|
11
11
|
- `TestWorkflow` — cross-command pipeline (bundle → validate/list/read)
|
|
12
|
-
- `TestConvertFile` — single-file conversion via `api.convert_file()`, mtime `generated` block
|
|
13
|
-
- `TestConvertContent` — raw markdown conversion via `api.convert_content()`, no `generated` block
|
|
12
|
+
- `TestConvertFile` — single-file conversion via `api.convert_file()`, mtime `generated` block, input frontmatter preservation
|
|
13
|
+
- `TestConvertContent` — raw markdown conversion via `api.convert_content()`, no `generated` block, input frontmatter preservation
|
|
14
14
|
- Core unit tests: `tests/test_core.py`
|
|
15
|
-
- parsing helpers (`parse_md`, `parse_frontmatter`)
|
|
15
|
+
- parsing helpers (`parse_md`, `parse_md_with_frontmatter`, `parse_frontmatter`)
|
|
16
16
|
- frontmatter generation (`build_frontmatter`)
|
|
17
17
|
- conformance engine (`check_conformance`)
|
|
18
18
|
- CLI integration tests: `tests/test_cli.py`
|
|
@@ -69,6 +69,7 @@ uv run pytest -q
|
|
|
69
69
|
|
|
70
70
|
- `.okfignore` parsing and skip semantics, including non-UTF-8 failure.
|
|
71
71
|
- Lenient parsing fallback when strict markdown format is missing.
|
|
72
|
+
- Input frontmatter merging precedence: `type`/`generated` overwritten, `okf_version` dropped, input `title`/`description` override parsed body, malformed frontmatter fallback (normal) vs fatal (`--strict`).
|
|
72
73
|
- Reserved filename differences between bundling and spec conformance.
|
|
73
74
|
- Root `index.md` special allowance for `okf_version` only.
|
|
74
75
|
- `list`/`read` hard failure on non-conformant bundles.
|
okf_cli-0.6.0/.last-update.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"head": "edbf961cebc0111bc42c88cff27f3ab83194f360", "timestamp": "2026-07-29T09:18:45Z"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|