okf index leaves a stale index.md when a directory's last concept is deleted
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 78/100
Research direction
Start in lib/src/index_generator.dart at OkfIndexGenerator.generate, especially the entries.isEmpty case, then trace how index generation compares and writes existing index.md files. Reproduce the scenario with okf index and --check after deleting the last concept. Done means an empty directory index is removed or rewritten, and --check reports the existing stale index.
Written by the indexing model from the issue text.
Description
Summary
When a directory's last concept is deleted, the index.md left in that directory is never updated or flagged. okf index reports "Indexes are current." and okf index --check exits 0, so the stale index keeps listing a directory that no longer exists.
Reproduce (okf 0.5.0)
- A bundle with one concept at
specs/seats/spec.md. okf index specs --declare-version 0.2. This writesspecs/index.md, which listsseats/.rm -rf specs/seatsokf index specs --declare-version 0.2printsIndexes are current.okf index specs --checkexits 0, andokf validate specs --strictprintsOK: 0 concept(s) validated.specs/index.mdstill contains* [seats](seats/index.md) - …
If a second concept remains in the bundle, the same deletion regenerates the root index correctly. Only the "no entries left" case is affected.
Cause
OkfIndexGenerator.generate in lib/src/index_generator.dart skips directories without entries:
if (entries.isEmpty) {
continue;
}
Nothing is generated for that path, so the writer never compares or rewrites the index.md already on disk, and check mode has nothing to report.
Expected
For an existing index.md whose directory has no entries, okf index --check reports it as stale, and okf index either removes it or rewrites it with no entries (keeping okf_version at the root).
- Dominant language
- Dart
- Stars
- 0
- Forks
- 0
- Avg merge
- 4h 39m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from btwld/okf
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
afk enhancement
Difficulty 4/5 3-5 days Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AppFlowy-IO/AppFlowy#9147 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
ccch1mneyyy/dsh-Go#1682 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 1/5 Under an hour Newbie friendliness 76/100
pesaclarity/ujumbe-parsers#64 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
patarapolw/lingua_srs#278 ·
Maintainers usually reply within 1 day