Skip to content
Cockpit0.29.0
A snapshot: read at commit 707a04c7ce8 on 2026-10-18T00:06:01Z by majordomus 0.29.0. Nothing on this page is read again. See it live

I0807

Discover knowledge sources from git, not from the filesystem

Where it stands

devtask.issue
Readiness
complete completion is recorded and every required evidence token is present
Status
DONE
Can start
not now
Milestone
Milestone status
ACTIVE
Wave
1
Waiting on
none
Holds back
Behind it in all
9
Evidence
1 of 1
A move writes the repository: it stamps one field of this issue's record and appends one event to the ledger, and a commit will carry both.
The same moves from a terminal

majordomus plan start I0807

majordomus plan verify I0807

majordomus plan done I0807

What it is

Objective
Implement the discovery stage of lib/knowledge.sh: a declared list of source classes, each with a scope of shared or operational, resolved through git ls-files for tracked repository artifacts and through the known state paths for operational records, producing a deterministic ordered list of sources with their content hashes.
Why
A recursive filesystem walk indexes vendored trees, build output, editor droppings and untracked files that were never meant to be knowledge, and it produces a different answer on two machines. git ls-files answers with repository truth, in a stable order, and is already the boundary this project treats as authoritative.
Now
Nothing in lib/ enumerates repository files. scripts/generate-site-data declares its canonical inputs, which is the precedent for a declared source list rather than a walk.
Wanted
`knowledge sources` prints each discovered source with its class, its scope and its hash, in a deterministic order, and the same repository produces the same list twice. An untracked file is not a source. Operational state paths are added explicitly and are marked operational, never shared.
Done when
unknown: the record declares no `completion`
Risk
The historical whitespace bug class lives here. Every pathname read out of git has to be read NUL-safely or with an explicit field separator, never through unquoted word splitting.

Acceptance

  • The source classes are declared in one place and each carries its scope
  • Discovery is driven by git for tracked sources, and a case proves an untracked file is excluded
  • The output order is deterministic and independent of filesystem order
  • A pathname containing a space or a non-ASCII character is handled without splitting
  • A declared source class that discovers nothing is reported, so a forgotten path is visible
Validation
bash test/run.sh 64_knowledge_discoveryshellcheck -x -s bash lib/knowledge.sh
Evidence required
discovery_deterministic
Evidence present
discovery_deterministic

Scope

Touches
lib/knowledge.shbin/majordomustest/cases/64_knowledge_discovery.sh
Not
Extraction, nodes, edgesAny recursive walk of a hidden directoryIndexing a path merely because it exists
Depends on
Priority
p1
Profile
implementation
Parallel safe
true
Owner
unknown: the record declares no `owner`

The work so far

Branches
none
Merged
none
Commits
0
Trunk
master
Sessions
none
Created
2026-09-04
Updated
2026-09-04T17:01:31Z
Started
2026-09-04T16:31:17Z
Verified
unknown: the record declares no `verified_at`
Completed
2026-09-04T17:01:31Z

Synchronisation

Adapter
scripts/github-sync
Repository
unknown: the derived plan's header carries no repository
External issue
unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it
State there
unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it

Findings

Nothing is wrong with these records.