docs: document protected_root renderer in egg_anchor [doc-updater] - #3263
Conversation
There was a problem hiding this comment.
Approve. Doc-only PR; I verified every documented claim against the implementation in shared/egg_anchor/protected_root.py, the package exports in shared/egg_anchor/__init__.py, and the referenced helpers. All accurate.
Verification:
- Signature in the README table matches
render_protected_root(*, role, role_contract, task_description=None, derived=None, directives=None, caps=None)atprotected_root.py:171-179exactly. RootCapsis documented as a frozen dataclass of per-section char/count caps with generous defaults — matches the@dataclass(frozen=True)definition.- Section order (ROLE CONTRACT → TASK → BRC ANCHORS (#3189) → NON-NEGOTIABLE DIRECTIVES) matches the section list assembled in
render_protected_root, including the literal(#3189)in the header. - Cap references (
role_contract_chars,task_chars,directives_chars) are all real fields applied via_truncate. - BRC ANCHORS contents (last-reviewed SHA, latest verdicts, open NACKs, conditional-ACK obligations; each sorted by a deterministic key) match
_render_anchors. - Exports:
RootCaps,render_protected_root, andBRCDerivedAnchorsare all in__init__.py's__all__, so the example'sfrom egg_anchor import ...lines work as written. - Referenced helpers
compose_task_description()(egg_contracts/loader.py:204) andderive_brc_anchors()(egg_anchor/brc_derive.py:136) both exist. caps=RootCaps(task_chars=6000)correctly illustrates tightening the 8000 default.- STRUCTURE.md:
protected_root.pyandtests/test_protected_root.pyboth exist on disk, so the tree and tests-description updates are correct.
Non-blocking nit:
- In the README example,
from egg_anchor import BRCDerivedAnchors # from models— the import resolves from the package root (re-exported via__init__.py), so the# from modelscomment is slightly misleading. Either drop the comment or say# re-exported from .models. Trivial.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Review feedback addressedThanks for the thorough verification of every documented claim. Non-blocking nit — misleading — Authored by egg |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Approve. Re-review of the delta since commit 40bcbea. The single new commit (13fc523) addresses the only outstanding item from my prior review — the misleading # from models import comment — and introduces no new issues.
Delta verification
- Nit fix confirmed:
shared/egg_anchor/README.md:197now readsfrom egg_anchor import BRCDerivedAnchors # re-exported from .models. This is accurate —BRCDerivedAnchorsis re-exported from__init__.py(shared/egg_anchor/__init__.py:13,31), so the package-root import resolves, and the comment no longer implies a direct.modelsimport path. Exactly what was requested.
Full re-verification of documented claims (doc-only PR)
- Signature matches
render_protected_root(*, role, role_contract, task_description=None, derived=None, directives=None, caps=None)atprotected_root.py:187-195. RootCapsis a@dataclass(frozen=True)(protected_root.py:39-40) with per-section caps;role_contract_chars=6000,task_chars=8000,directives_chars=4000— the example'sRootCaps(task_chars=6000)correctly illustrates tightening the 8000 default.- Section order (ROLE CONTRACT → TASK → BRC ANCHORS (#3189) → NON-NEGOTIABLE DIRECTIVES) matches
protected_root.py:223-228, including the literal(#3189). - Cap fields referenced in the README (
role_contract_chars,task_chars,directives_chars) all exist and are applied via_truncate. - Exports:
RootCaps,render_protected_root(__init__.py:25,41,46) andBRCDerivedAnchors(__init__.py:13,31) are all in__all__, so the example imports work as written. - Referenced helpers both exist:
compose_task_description(shared/egg_contracts/loader.py:204) andderive_brc_anchors(shared/egg_anchor/brc_derive.py:136). - STRUCTURE.md:
shared/egg_anchor/protected_root.pyandshared/egg_anchor/tests/test_protected_root.pyboth exist on disk; the tree entry and tests description are correct.
No blocking issues. No remaining suggestions.
— Authored by egg
|
egg review completed. View run logs 3 previous review(s) hidden. |
docs: document protected_root renderer in egg_anchor [doc-updater]
Update documentation to reflect changes from #3239 (slice-4 of #3200):
protected_root.pyto the Files table inshared/egg_anchor/README.mdrender_protected_root()andRootCaps, including the fixed four-section layout and a usage exampledocs/development/STRUCTURE.mdto listprotected_root.pyin theegg_anchor/directory treeTriggered by: #3239
Issue: none
Test Plan
shared/egg_anchor/protected_root.pyAuthored-by: egg