Revision: 1 Last modified: 2026-12-04T19:00:00Z
enumerate.sh discovers and enumerates the consumers of this constitution and writes them to a JSON
document.
It is a thin POSIX-sh entrypoint: the entire body is exec python3 _enumerate_impl.py "$@". The real
work — multi-source probing, JSON construction and needle checks — lives in the co-located
_enumerate_impl.py (Python stdlib plus PyYAML for --config parsing). That split is deliberate: the
shell layer exists only so callers have a stable sh entrypoint in a sh-oriented tool tree, and it
adds no logic of its own that could drift from the implementation.
The interesting judgement is in exit code 5. "One or more probes degraded" is a partial
enumeration — some sources answered, some did not. Returning a plain success would present a partial list
as a complete one; returning a hard failure would discard the sources that did answer. The code is
distinct so a caller can decide, and the --out document's source_reachability block records which
sources were actually reached.
shfor this entrypoint;python3plus PyYAML for the implementation._enumerate_impl.pybeside it (resolved relative to this script, not the caller'scwd).- A fastcycle config file (
--config) naming the sources to probe. - No environment variables are read.
# enumerate consumers
sh scripts/fastcycle/consumers/enumerate.sh \
--config fastcycle.yaml --out consumers.json
# prove the enumeration is reproducible
sh scripts/fastcycle/consumers/enumerate.sh \
--config fastcycle.yaml --out consumers.json --determinism-check| Code | Meaning |
|---|---|
0 |
OK — enumeration complete. |
1 |
Determinism mismatch (--determinism-check only). |
2 |
Usage error (bad/missing flags, unparseable config). |
3 |
Control-needle failure (CA-004) — the enumerator's own instrument could not be trusted. |
4 |
All sources unreachable — no enumeration is possible. |
5 |
One or more probes degraded: a partial enumeration. Consult the --out document's source_reachability block (T177 Round 1 B1). |
Codes 4 and 5 are the pair that keeps a partial answer honest. 4 means "nothing could be reached";
5 means "some things could, and here is which".
- Every source unreachable. Exit
4, not an empty0. An empty consumer list and an unreachable network must not look the same. - One source down. Exit
5with the document still written, so a caller can proceed knowingly on partial data rather than being blocked or misled. - Needle failure. Exit
3; the needle exists (CA-004) so a genuinely empty result and a broken probe are distinguishable. --determinism-checkmismatch. Exit1, meaning the same inputs produced two different enumerations.- A
--configwithout the expected structure. Usage error (2) rather than a silently empty probe set. - The implementation file missing. The
execfails and the shell's own error surfaces — this entrypoint adds no fallback, by design.
- Resolves its own directory (
HERE) from$0, not from the caller'scwd. execspython3 "$HERE/_enumerate_impl.py" "$@"— argument pass-through with no translation.- The implementation probes each configured source, builds the consumer document, runs the CA-004
needle, records
source_reachability, and writes--out. - The process exit status is the implementation's own; this script has no code path that could change it.
Calls scripts/fastcycle/consumers/_enumerate_impl.py.
Related in the same contract family (contracts/consumer-audit-and-migration.md, CA-001..CA-005):
scripts/fastcycle/consumers/migrate.sh (migration, CA-019..CA-028) and
scripts/fastcycle/consumers/audit.py (consumer audit).
Guarded by scripts/fastcycle/tests/test_consumer_enumerate_red.sh (T166).
See also docs/scripts/migrate.sh.md and docs/scripts/audit.py.md.
2026-12-04 — bash -n scripts/fastcycle/consumers/enumerate.sh → exit 0. sh scripts/fastcycle/consumers/enumerate.sh with no arguments exits 2 (required --config and --out
absent, rejected by the implementation).