Skip to content

Make one command check a library entry, and open the watchdog category - #18

Merged
AetherAI3 merged 2 commits into
mainfrom
lane3/contributor-path
Aug 19, 2026
Merged

Make one command check a library entry, and open the watchdog category#18
AetherAI3 merged 2 commits into
mainfrom
lane3/contributor-path

Conversation

@AetherAI3

Copy link
Copy Markdown
Owner

Why does this change belong in Nano?

A first-time contributor could compile a rule but could not tell whether it was shaped like the rest of the library. The suite proves an entry compiles to its pinned IR and replays deterministically. It says nothing about two conventions every entry actually follows, and both were held up by review attention alone.

The drift was already in the tree:

  • Six risk/ entries ship with json.dumps(indent=2) output instead of the library's one-node-per-line format. CONTRIBUTING.md said "keep it formatted like neighboring entries" and offered no tool that produces that format — nano compile emits correct IR in the wrong shape.
  • Every one of the 32 entries carries a REGIME: / CONDITIONS: / INVALIDATION: / SHAPE: / CALIBRATED ON: header plus a NOT <neighbour>: line. Nothing documented that anywhere, so a newcomer would have found out in review.
  • The library README claimed 26 strategies while shipping 32.

What changed?

Contributor tooling

scripts/check_contribution.py checks one entry or the whole library — compilation, IR agreement, house formatting, the comment header, signal documentation, StrategyGraph round trip, replay determinism, and the effects boundary:

$ python scripts/check_contribution.py --write nano/library/watchdog/my_rule.nano
wrote nano/library/watchdog/my_rule_ir.json
$ python scripts/check_contribution.py nano/library/watchdog/my_rule.nano
1 entry ready for review.

--write generates or repairs the _ir.json partner in library format, so nobody hand-reflows JSON again. It reads utf-8-sig, so a BOM is not a first-contribution error. CI runs --all on every PR.

The six drifted risk/ fixtures are reformatted — no semantic change, the suite compares parsed JSON.

Documentation

docs/first-contribution.md walks the path once with a real rule: idea → .nano → generated IR → deterministic replay → CI → PR. Its example is compiled by tests/test_docs.py rather than being prose. nano/library/README.md documents the header convention and the optional SOURCE: provenance field; CONTRIBUTING.md gains the checker command, the watchdog path, and an attribution section.

The watchdog/ category

The README has advertised deterministic watchdogs since v0.1.0 with nowhere in the library to put one. Two entries — trusted_route_guard (PAUSE) and credential_age_alert (OBSERVE) — establish the shape: host-measured system and policy state, the same nonnegative rises-as-it-worsens direction convention as risk/, and never a proposed direction, which tests/test_library.py now enforces across the whole category. The category is deliberately thin; the rest are seeded as issues.

CLI

nano check on a file saved with a UTF-8 BOM reported Unexpected character '' at 1:1 — naming an invisible character in a correct program, on the first command a Windows contributor runs. Reading as utf-8-sig fixes it without touching the grammar; a BOM carries no meaning inside a program and every other byte still has to be valid UTF-8.

Stale claims, pinned rather than only corrected

The library count, the category list, and the root README's per-category table all get drift guards, in the same spirit as the existing test_docs.py test-count guard. Repository links across README, CONTRIBUTING, SECURITY, pyproject.toml, and the issue-template config still pointed at the pre-rename DBarr3 namespace. .gitignore now covers the .venv that CONTRIBUTING tells a newcomer to create.

Validation

  • Focused tests passed.
  • python -m pytest -q passed — 415 passed, 2 skipped (was 401 passed, 2 skipped).
  • python scripts/check_contribution.py --all passed — 34 entries ready for review.
  • Documentation and examples match the shipped behavior.

The checker was tested in both directions rather than only written. Against the library as it stood it reported the six formatting-drifted risk/ fixtures. Against a deliberately incomplete probe rule — saved with a BOM, missing every header field, using an undocumented signal, with no IR partner — it reported all seven problems and named the fix for each. The BOM itself passed through both the checker and nano check without complaint, which is the point.

Boundary check

  • The change preserves deterministic reference execution for identical graph/frame inputs.
  • The change does not bypass the host-owned DecisionGate or add external actuation to Nano source/runtime.
  • If this adds a strategy, it includes paired .nano and _ir.json files plus documented host signal conventions.
  • If this adds a watchdog rule, it emits pause/observe only and its signals are nonnegative and rise as the situation worsens.

Nothing here weakens a boundary; the checker adds one that was previously only implied, refusing any entry declaring effects beyond intent.emit and log.append. The watchdog entries propose intents like every other entry — Nano does not inspect a network, read a key store, or enforce anything.

🤖 Generated with Claude Code

@AetherAI3

Copy link
Copy Markdown
Owner Author

Rebased the branch to drop the pure DBarr3AetherAI3 link edits — #16 owns that change. SECURITY.md, examples/README.md, nano/bridge/provenance.py, pyproject.toml, and .github/ISSUE_TEMPLATE/config.yml are no longer touched here at all, and the badge, clone, and language-proposal lines in README.md/CONTRIBUTING.md are back to their original form.

Two lines still overlap because both PRs genuinely rewrite them — the README's browse-links row and the library README's contribute-links row, where this PR adds the Your first contribution → entry. Whichever merges second takes the other's namespace fix on those two lines; everything new here already uses AetherAI3.

dbarr5 and others added 2 commits August 19, 2026 07:44
…atchdog category

A first-time contributor could compile a rule but could not tell whether it was
shaped like the rest of the library, because two of the library's four
conventions were enforced by review attention alone.

The drift that produced this was already in the tree. Six risk/ entries shipped
with the compiler's default JSON indentation rather than the library's one-node-
per-line format, because CONTRIBUTING said "keep it formatted like neighboring
entries" and offered no tool to do it. Every entry carries a REGIME/CONDITIONS/
INVALIDATION/SHAPE/CALIBRATED ON header and a NOT line; nothing documented that,
so a newcomer would have discovered it in review.

- scripts/check_contribution.py checks one entry or the whole library:
  compilation, IR agreement, house formatting, the comment header, signal
  documentation, StrategyGraph round trip, replay determinism, and the effects
  boundary. `--write` generates or repairs the _ir.json partner in library
  format, so nobody hand-reflows JSON again. Reads utf-8-sig, so a BOM is not a
  first-contribution error.
- CI runs it over the whole library on every pull request.
- The six drifted risk/ fixtures are reformatted. No semantic change; the suite
  compares parsed JSON.
- docs/first-contribution.md walks the path once with a real rule, and its
  example compiles under tests/test_docs.py rather than being prose.
- nano/library/README.md documents the header convention, the SOURCE: provenance
  field, and the checker. CONTRIBUTING.md gains the checker command and an
  attribution section.

The watchdog category opens the use case the README has advertised since v0.1.0
with nowhere in the library to put it. Two entries - one PAUSE, one OBSERVE -
establish the shape: host-measured system and policy state, the same nonnegative
rises-as-it-worsens direction convention as risk/, and no direction ever
proposed, which tests/test_library.py now enforces for the whole category.

CLI: `nano check` on a file saved with a UTF-8 BOM reported `Unexpected
character` at 1:1, naming an invisible character in a correct program. Reading
as utf-8-sig fixes it without touching the grammar.

Stale claims pinned rather than only corrected: the library README said 26
strategies while shipping 32, so the count, the category list, and the root
README's per-category table all get drift guards. .gitignore now covers the
.venv that CONTRIBUTING tells a newcomer to create.

New links added here use the AetherAI3 namespace, but the existing DBarr3 links
are deliberately left alone; PR #16 owns that change, and duplicating it would
only conflict.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR #17 landed nano/watchdog/, the runtime profile that admits a rule under a
narrower contract; this branch adds nano/library/watchdog/, the corpus written
for it. They arrived from separate changes with nothing connecting them, so a
reader met two things called "watchdog" and no statement of how they relate.

Both library entries are admissible under the profile as written. A test pins
that for the whole category, synthesising each rule's signal specs from what it
actually reads, so the assertion is about admissibility - opcodes, tier, effects,
intents, cadence - and not about any one host feed. The corpus and the runtime
can no longer drift apart silently.

The library README, CONTRIBUTING, and the first-contribution walkthrough now say
which is which, and say plainly that contributing an entry asks nothing extra: a
rule following the two category conventions already qualifies, and the signal
contract belongs to the host deploying it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@AetherAI3
AetherAI3 force-pushed the lane3/contributor-path branch from 4d7ab2f to 20d5167 Compare August 19, 2026 11:46
@AetherAI3

Copy link
Copy Markdown
Owner Author

Rebased onto main after #16 and #17 landed. Three link-row conflicts resolved in favour of the canonical AetherAI3 URLs plus this PR's new entries.

#17 landing changed something worth acting on: it added nano/watchdog/, the runtime profile that admits a rule under a narrower contract, while this PR adds nano/library/watchdog/, the corpus written for exactly that. Two things called "watchdog" arriving from separate changes with nothing stating how they relate.

Both library entries turn out to be admissible under the profile as written — verified, not assumed:

trusted_route_guard  ADMITTED -> cadence 1m, risk_class LOW, unavailable_policy HOLD
credential_age_alert ADMITTED -> cadence 1d, risk_class LOW, unavailable_policy HOLD

A new test pins that for the whole category, synthesising each rule's signal specs from what it actually reads, so the assertion is about admissibility — opcodes, tier, effects, intents, cadence — and not about any one host's feed. The corpus and the runtime can no longer drift apart silently. The library README, CONTRIBUTING, and the walkthrough now say which is which, and say plainly that contributing an entry asks nothing extra of a contributor.

Suite is 457 passed, 2 skipped; check_contribution.py --all reports 34 entries ready for review. All six CI jobs green on 20d5167.

One note for whoever picks up #15 (SuperTrend): I checked it against the checks this PR adds and it passes both — its IR is already in library format and its header carries all five required fields plus a NOT line. It will need a text conflict resolution on README.md, nano/library/README.md, and tests/test_library.py, which it needed against main anyway.

@AetherAI3
AetherAI3 merged commit 4836197 into main Aug 19, 2026
6 checks passed
AetherAI3 pushed a commit that referenced this pull request Aug 19, 2026
#18 landed the contribution checker, the watchdog library category, and drift
guards on the library counts, which conflicted with this branch's own count
updates. Both conflicts were the same class: a strategy total that each side had
bumped independently.

Resolved to main's table shape with trend/ at 4 to include supertrend_flip_long,
and the library README total at 35.

The entry itself needed no changes. It already passes the checks #18 added:
its _ir.json was written in the library's one-node-per-line house format, and
its comment header carries all five required fields plus a NOT line. The full
suite is 471 passed, 2 skipped and check_contribution.py --all reports 35
entries ready for review.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants