Data Model: Shared battery collection and complete shard-timing provenance

Stored collection record

One JSON file per collection key in the store directory.

FieldTypeRule
schemaint1; any other value is treated as absent
keystrhex digest; must equal the consumer's computed key
commitstrgit rev-parse HEAD at production; must equal the consumer's
treestrgit rev-parse HEAD^{tree} at production; must equal the consumer's
created_atstrISO-8601 UTC, informational
countintmust equal len(records) and be at or above the collection floor
recordslist{nodeid, relpath, markers} exactly as collect_universe() returns today

Invariants

  • A record is written only after a collection that completed with an accepted exit status and produced its dump.
  • A record that fails any rule above is treated as absent and replaced by the next successful collection.
  • Writing a record removes every other record file in the store directory.
  • The store is neither read nor written when the checkout has uncommitted changes or the caller passed a repo_root override.

Collection key inputs

InputSource
committed treegit rev-parse HEAD^{tree}
interpretersys.version_info (major, minor, micro) and implementation name
platformsys.platform
dependenciesdigest of sorted name==version of installed distributions
environment familysorted NAME=value for SPEC_KITTY_* and PYTEST_ADDOPTS, minus the declared exclusions, taken after the operator env file (.kitty.env, both tiers) is overlaid with the product's own loader

Reuse report line

One JSON object per collect_universe() call, appended to the report file named by an environment variable (no file, no report).

FieldValues
outcomereused \
reasonfor collected/bypassed: no-record, invalid-record, origin-mismatch, dirty-checkout, root-override, unsupported-platform, git-unavailable, env-file-unreadable
detailfree text for a lock or store failure reported as bypassed / unsupported-platform
dirty_pathsfor dirty-checkout: the first five paths that made the checkout dirty
keythe computed key, or null when bypassed
callerthe requesting test file or prestep
secondswall time of the call

Module timing data (existing, .github/ci-shard-timings.json)

SectionRule after this mission
module_test_durations[module]written only by the capture producer
module_test_count[module]equals the collected count at the capture commit (strict)
module_capture_provenance[module]present for every registry module; valid per the shared predicate (exit status 0 or 1, at least one duration)

Recapture run result

FieldMeaning
driftedmodules whose committed count or provenance disagrees with the count-only pass
capturedmodules recaptured this run
failedmodules whose capture was not valid; committed data untouched
deferreddrifted modules not started because the time budget was spent

State transitions for one module in one run: clean (no action) or drifted → captured \| failed \| deferred. The run exits non-zero when failed is non-empty.