Skip to content

fix(docs): give the README a Context section and write the architecture doc - #7

Merged
catinspace-au merged 1 commit into
mainfrom
fix/readme-context-section
Sep 21, 2026
Merged

catinspace-au merged 1 commit into
mainfrom
fix/readme-context-section

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

The most surprising fact about this repo was nowhere in it. dfe-engine imports logreducer at RUNTIME and declares no dependency on it, deliberately, at three lazy import sites inside the gated smart and anomaly sampler modes. An ImportError there becomes a message telling the caller to use mode=recent or mode=random. That is now the whole of "Where this sits", with the sites named, because there is no version range for anyone to test against -- you install a new version alongside dfe-engine and run the tests that touch those three lines.

What landed:

  • README gets a ## Context section in the five fixed subheadings, below ## License and last in the file. hyperi-ai docs context passes.
  • docs/architecture.md is new -- the problem a random sample does not solve, why the Source/Sink protocols are the whole integration surface, why re-iterability is the contract that shapes every adapter, what streams and what cannot, why every sample is seeded, and eight invariants.
  • Dropped "right now" from the CLI bullet while the file was open. It was a DOC-TIME-1 lint finding and the next sentence already says it.

Four things that were true and unwritten, now in the Context section:

  • Nothing is deselected by default. addopts is only -ra -q --strict-markers --strict-config, so tests/integration/ is collected and then SKIPS without an endpoint or Docker. CI sets no env vars and always takes the docker path, so a green local run may have proved nothing about the adapters.
  • The version in the tree is a release behind. pyproject.toml and VERSION say 3.4.0, the newest tag is v3.5.0, PyPI serves 3.5.0.
  • min_coverage: 75 gates while its own comment says actual is 80.
  • vulture is set to warn, because a library's public API reads as unused to dead-code analysis.

Every Don't/Do/Why row traces to a comment in core.py, to CONTRIBUTING.md, or to open issue #5. #5 gets a row of its own, since a consumer reading LogPattern.template today gets a first-seen snapshot rather than the final Drain3 template.

One thing that will date: dfe-engine's stated reason for not declaring the dependency is to pin it "once it hits public PyPI", and 3.4.0 was published there on 2026-07-03. The Context section says to expect that edge to become an ordinary pinned dependency. The change belongs in dfe-engine, not here.

NOT verified: no test run. uv sync and pytest were not run, so the commands are quoted from CONTRIBUTING.md, .hyperi-ci.yaml and pyproject.toml. CI on this PR runs the real suite -- pull_request has no path filter here, so a docs-only PR gets the full gate.

Done when this is merged and the README's ## Context is the one place the working guide lives.

…re doc

The single most surprising fact about this repo was nowhere in it: dfe-engine
imports logreducer at runtime and declares NO dependency on it, deliberately, in
three lazy import sites inside the gated sampler modes. That is now the whole of
"Where this sits", with the sites named.

Also recorded, because all four are true and none was written down: nothing is
deselected by default, so tests/integration/ is collected and then SKIPS without
an endpoint or Docker; the version in the tree is a release behind the tag and
PyPI; min_coverage gates at 75 while its own comment says 80; and vulture warns
rather than fails.

Verified against origin/main this pass: the three import sites read out of
dfe-engine at sampling/service.py:200 and :236 and sampling/kafka_reader.py:134,
with the non-declaration recorded at its pyproject.toml:114. Tag v3.5.0 against
pyproject version 3.4.0, and PyPI serving 3.5.0 with 3.4.0 published
2026-07-03. Every Don't/Do/Why row traces to a comment in core.py, to
CONTRIBUTING.md, or to open issue #5.

Dropped "right now" from the CLI bullet while the file was open -- it was a
DOC-TIME-1 finding and the next sentence already says it.

Not verified: no test run. uv sync was not run and pytest was not run, so the
commands are quoted from CONTRIBUTING.md, .hyperi-ci.yaml and pyproject.toml
rather than from a run.
@catinspace-au
catinspace-au force-pushed the fix/readme-context-section branch from 6fa5d69 to dd17234 Compare September 21, 2026 00:11
@catinspace-au
catinspace-au merged commit 9d6a2aa into main Sep 21, 2026
15 checks passed
@catinspace-au
catinspace-au deleted the fix/readme-context-section branch September 21, 2026 00:24
@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant