Skip to content

replicator-boundaries.md: Archiver produces content.fetch-policy; link the cohort charter #137

Closed

Description

@gregoryfoster

Update the producer named in docs/contracts/replicator-boundaries.md (Watcher → Archiver; payload unchanged plus optional generation) and link cannobserv/docs/BOUNDARIES.md as this document's parent.


Phase: Phase 1 — build additive and dark
Epic: #135
Blocked by: CannObserv/cannobserv#562
Design: 2026-10-14-headless-watcher-and-cohort-boundaries-design.md (watcher)

Activity

  1. gregoryfoster commented on Oct 17, 2026

    @gregoryfoster
    ContributorAuthor

    Pre-flight note (coordinator, epic #135, 2026-10-17). No brief yet. This child follows #140, because both edit AGENTS.md.

    • Unblocked. CannObserv/cannobserv#562 merged as d107e8ff on 2026-10-16. cannobserv's docs/BOUNDARIES.md exists and names docs/contracts/replicator-boundaries.md as its annex [stated, #562's shipped comment].
    • Keep the producer change phase-aware. Watcher stays the producer until F1 (F1: stop the content.fetch-policy producer watcher#374), so a flat "Archiver produces" would be false on merge day. CannObserv/cannobserv#566 uses the same framing in co-core's docstring: Watcher until F1, then Archiver through an outbox.
    • Sites that name Watcher as the producer [measured, grep]:
      • docs/contracts/replicator-boundaries.md:65, :165-172 and :208-215
      • the src/worker/policy.py module docstring
      • docs/POLITENESS.md
  2. gregoryfoster commented on Oct 17, 2026

    @gregoryfoster
    ContributorAuthor

    Brief (coordinator, epic #135, 2026-10-17)

    Edited 2026-10-17 (coordinator): reordered. This child now follows #136 (operator decision 2026-10-17, after co-core v0.37.0 published). Hazard 1 is settled: once #136 has shipped, say that Replicator applies generation through co-core's fetch_policy_supersedes, and link src/worker/policy.py as the code of record. Re-run the pre-flight against origin/main once #136 has merged.

    Pre-flight run against origin/main at 3abaa81. The pre-flight note above still stands; this adds to it.

    Authorities. This issue's body. The design of record, "Replicator" under "Sibling-repo work" (CannObserv/watcher docs/plans/2026-10-14-headless-watcher-and-cohort-boundaries-design.md). cannobserv's docs/BOUNDARIES.md as merged (d107e8ff, its status line rewritten by CannObserv/cannobserv#566). Where they disagree, stop and ask.

    What changed since filed:

    • The charter exists, and line 5 already names this doc as its annex [measured]. Its "Where the cohort stands" section says fetch-policy frames are ordered only once Archiver produces them.
    • CannObserv/cannobserv#566 shipped generation and fetch_policy_supersedes. The release is CannObserv/cannobserv#568 (v0.37.0, being cut now).
    • Catch up co-core 0.19.6 → 0.36.0 ahead of the generation release #140 put AGENTS.md at 5991 of 6000 tokens (exact).

    Blockers: none.

    Hazards, to weigh

    1. Say what's true on merge day. Watcher is the producer until F1 (F1: stop the content.fetch-policy producer watcher#374), and Replicator doesn't apply generation until Apply FetchPolicyState.generation only if newer #136 ships. [Operator decision: this child names the producer change, phase-aware, and the charter as parent; the sentence saying Replicator applies generation lands with #136, which changes the consumer — recommend this]. The design's "payload unchanged plus optional generation" can be stated now, as the wire.

    2. The header contradicts the annex role. Lines 3–6 say "Status: normative. Home: this file … Sibling repos link here rather than copying" [measured]. Make the charter the parent: cohort-wide rules live there, and this doc applies them to Replicator. Keep the three tests and tests/test_boundaries.py as this doc's own. Don't copy charter text in. Link it.

    3. Sites that name Watcher as the producer (from the pre-flight note):

      • replicator-boundaries.md: :65, :165-172 ("Producer: Watcher for Phase 4 … can later move to Archiver", now decided) and :208-215
      • docs/POLITENESS.md

      src/worker/policy.py's docstring is Apply FetchPolicyState.generation only if newer #136's, because Apply FetchPolicyState.generation only if newer #136 edits that file. A grep for Watcher together with policy|producer|min_interval finds them all. Past-tense history (#245, watcher#272) stays as it is.

    4. AGENTS.md has 9 tokens of headroom. The charter asks each sibling to link it from its own AGENTS.md, and this is replicator's docs issue for that. A new line won't fit. [Operator decision: reword the existing Detail Docs line for replicator-boundaries.md so it names cannobserv's charter as its parent, holding the token count — recommend; the alternative is a trim elsewhere, which needs a curating-context pass]. Measure exactly. The context-budget guard warns on growth.

    5. The curation ledger. .skills/context-loss-ok has tighten/retarget entries scoped to replicator-boundaries.md lines (:302-312, :413-417, :609) [measured]. If you rewrite a line one of them matches, the entry goes stale. That's harmless, but prune what you orphan.

    6. Link form. The charter is in a private repo. Link it by its GitHub URL, repo-qualified, the way the charter links this doc.

    Expected: docs only. CI runs anyway. Check whether tests/test_boundaries.py reads this file; on origin/main it doesn't reference it by name [measured].

    Post-merge: no host steps. If you edit .socraticodecontextartifacts.json, run codebase_update from the main checkout.

    Out of scope:

    Template: #139 / #141's docs commits, for curation hygiene.

  3. gregoryfoster commented on Oct 18, 2026

    @gregoryfoster
    ContributorAuthor

    Addendum to the brief: pre-flight re-run after #136 (coordinator, epic #135, check-in 2, 2026-10-18). Against origin/main e3cb04f. This is the epic's last child.

    For #137, from #136's build report [stated]: src/worker/policy.py's module docstring is now the code of record for ordering, and docs/POLITENESS.md's "Arrival order" bullet states the rule. Link to them; don't restate them in replicator-boundaries.md.

    What #136 changed for this brief [measured]:

    • Hazard 1 is settled as written. Replicator applies generation through fetch_policy_supersedes, deployed on build e3cb04f since 2026-10-17T23:07Z. For frames without a generation, it keeps the occurred_at guard (operator decision).
    • Hazard 3 is narrower. policy.py's docstring and docs/POLITENESS.md already say which producer publishes in each phase (Watcher until F1, then Archiver). What's left is replicator-boundaries.md itself: :65, :165-172 and :208-215.
    • Hazard 4 is unchanged. Apply FetchPolicyState.generation only if newer #136 changed only AGENTS.md's pin digits (0.36.0,<0.37 → 0.37.0,<0.38), so it's still about 5991 of 6000 tokens. Measure exactly before and after.
    • The manifest. Apply FetchPolicyState.generation only if newer #136 edited three descriptions and the index has been refreshed (2026-10-18). If this child edits the replicator-boundaries.md description, run codebase_update from the main checkout after the merge.
  4. gregoryfoster commented on Oct 18, 2026

    @gregoryfoster
    ContributorAuthor

    Brief review (implementer, 2026-10-18)

    Checked against origin/main e924f97 (e3cb04f plus a skills-submodule bump), the charter as merged, and the design's C-d and "Replicator" sections. No disagreement among the authorities, so nothing to stop on. These corrections change what I build.

    Corrections

    1. :208-215 stays as it is. That passage is the watcher#245 / watcher#272 history, which the brief also says to leave alone. It's true on merge day too: Watcher's limiter really was replaced by its producer. The phase-aware producer sentence goes in the "Producer" paragraph (:165-168) only.
    2. :172 stays. It says the 1.0 s fallback is "Watcher's own DEFAULT_MIN_INTERVAL". That's where the number came from, and it's still true: the constant exists on watcher origin/main, src/core/models/domain.py [measured, git grep]. docs/POLITENESS.md:185 says the same thing. Both go stale when Watcher deletes the constant, so they're noted below for the post-F1 cleanup.
    3. A site the grep missed: :139, "Last-write-wins per host key". It doesn't name Watcher, but since Apply FetchPolicyState.generation only if newer #136 the order is generation, with an occurred_at guard and a ratchet. Following the addendum, I'll keep "LWW" (it's the charter's channel-rule wording) and link POLITENESS.md's Applying a policy section rather than restate the rule. The manifest's boundaries-charter description repeats the same phrase and calls the doc "sibling to the issuer contract". I'll edit that too, so there is one post-merge host step: codebase_update from the main checkout.
    4. Hazard 5 has nothing to prune. None of the .skills/context-loss-ok entries scoped to replicator-boundaries.md (:302-312, :413-417, :609) matches a line on origin/main, and neither does the old-form AGENTS.md :: tighten :: entry at :381 [measured, exact line comparison]. They warrant lines that Adopt the shared SocratiCode index on co-index #92 and Five docs are over the 10k per-doc context budget; AGENTS.md has 49 tokens of headroom #111 already removed. prove-no-loss.sh checks warrants against the base's lines, so this change can't orphan them.

    Confirmed as written

    • AGENTS.md is 5991 of 6000, exact (measure-context.sh --exact, 252 lines). replicator-boundaries.md is 9167 of 10000.
    • tests/test_boundaries.py doesn't read the doc. It only cites it, in its module docstring and in a comment at :160. test_destinations.py and worker/test_handler.py also cite it only in docstrings.
    • The cohort charter's :5 names this doc as the annex. Watcher stays the producer until F1, watcher#374.

    What I'll build

    • Header :3-6. Normative as the cohort charter's Replicator annex. Cohort-wide rules live and change there, and this file applies them. The three tests and test_boundaries.py's invariants stay this file's own. The charter is linked by its repo-qualified GitHub URL.
    • :65. The numbers sit in Watcher's Domain table until F1, then in Archiver, which owns all operator intent under the charter.
    • Producer :165-168. Phase-aware. The payload is unchanged apart from the optional generation. Replicator applies it through fetch_policy_supersedes, with links to POLITENESS.md and src/worker/policy.py, not restated. Nothing branches on which producer sent a frame.
    • :139. See correction 3.
    • Refs. Add the charter, cannobserv#566, Apply FetchPolicyState.generation only if newer #136 and watcher#374.
    • AGENTS.md Detail Docs line. Reworded so it names the charter as parent, held at ≤ 5991 exact.

    An accepted limit, flagged now. The doc calls itself "charter" (in the title and about eight self-references), and so do STREAMS.md, CONVENTIONS.md, AGENTS.md's "enforces the charter in CI" and the test docstrings. With a cohort charter above it, that word is now ambiguous. I'll keep the title and those references: renaming them all is wider than this issue. The header and the AGENTS.md line say "annex", which is what disambiguates.

  5. gregoryfoster commented on Oct 18, 2026

    @gregoryfoster
    ContributorAuthor

    Build report (implementer, 2026-10-18)

    Branch 137-boundaries-charter-parent, 6 commits on e924f97, not pushed yet: paused before shipping. Docs and ledgers only, no runtime code.

    Operator decision, taken mid-build. Hazard 4's recommended path didn't fit. The charter URL alone costs about 33 tokens against 9 of headroom: the best reworded line measured 6024 of 6000, and naming the charter without a link measured 6003. The operator chose a curating-context pass in this PR over a follow-up or a separate curation child.

    What changed

    • replicator-boundaries.md (9167 → 9726 of 10000, exact):
      • Header. Normative as the Replicator annex to cannobserv's docs/BOUNDARIES.md, linked by its repo-qualified URL. Cohort-wide rules live and change there. The three tests and the test_boundaries.py invariants stay this file's own.
      • :65. The numbers sit in Watcher's Domain table until F1, then in Archiver.
      • :139. LWW, "ordered as applying a policy states (Apply FetchPolicyState.generation only if newer #136)".
      • Producer paragraph. Watcher until F1 (watcher#374), Archiver after it. The payload is unchanged apart from the optional generation (cannobserv#566). Replicator applies it through fetch_policy_supersedes, with links to POLITENESS.md and src/worker/policy.py, not restated.
      • Refs. Added the charter, Apply FetchPolicyState.generation only if newer #136 and watcher#374.
      • :172 and :208-215 are untouched, per my brief review.
    • .socraticodecontextartifacts.json. The boundaries-charter description names the parent charter, the generation ordering and the phase-aware producer.
    • AGENTS.md: 5991 → 5990 exact.
      • New line: - [cohort charter](<URL>) — its parent, nested under the boundaries line so "its" has one referent.
      • Extending the boundaries line in place was refused by prove-no-loss.sh's index check, which counts only docs inside the repo. So the charter gets its own line and the old line stays verbatim.
      • Ten class-C tightenings pay for it, each warranted in .skills/context-loss-ok. The --claims check passes with no atom dropped. No relocations, no deletions. One context-counts-ok entry is retargeted to its tightened line.
    • Telemetry:
      • Baseline row at e924f97 (5991 exact), measured from a detached branch-point worktree.
      • Curation row at 37f693e (5990): relink:cohort-charter plus prune: ×8, no_loss ok, 12 warranted, seams 0 (39 acknowledged), counts 0 (4 acknowledged).

    Code review: one round, two fixes

    Item Action Result
    1 Fixed 82b0d98: the curation row's tags were off-vocabulary (tighten:, add:); retagged to relink:/prune: with --amend
    2 Fixed 37f693e: "— its parent" read ambiguously; the line is now nested, and the indent's token is paid by one more warranted tighten
    3 Stet 4b4dc48's message says 9793 → 9733, but the doc landed at 9726 because a reflow went into the same commit. The ledger is right; not rewriting history for it
    4 Stet The boundaries doc is NEAR budget (9726 of 10000); noted below

    Verification run

    • uv run pytest: 1421 passed, 1 skipped, 71 deselected, coverage 99.89%. ruff check and ruff format --check are clean. That's the epic baseline of 1408 plus Apply FetchPolicyState.generation only if newer #136's tests.
    • prove-no-loss.sh --base e924f97 --claims: lost 0, claims dropped 0. check-seams.sh: 0. check-counts.sh: 0.
    • measure-context.sh --exact: no dead links, dead anchors, orphans or unindexed docs.
    • Both issues linked resolve: watcher#374 (open, "F1: stop the content.fetch-policy producer") and cannobserv#566 (closed). The charter was read through the contents API.

    Skipped verification

    • CI hasn't run, because the branch isn't pushed.
    • codebase_update hasn't run. It's a post-merge step from the main checkout.
    • validate-manifest resolved to the main checkout's manifest, not the branch's. The branch's edited JSON was only parse-checked (json.loads).
    • Not checked on GitHub: how the external links render, and whether the private-repo charter URL opens for a reader without cannobserv access.
    • The boundaries doc got no --file seams or counts sweep: it was edited, not curated.

    Accepted limits

    • The doc keeps the name "charter", in its title and about eight self-references, as do STREAMS.md, CONVENTIONS.md, AGENTS.md and the test docstrings. With a cohort charter above it, the word is now ambiguous. "Annex" in the header and in the nested AGENTS.md line is what disambiguates.
    • The boundaries doc has 274 tokens of headroom.
    • A charter wording point, left to cannobserv. The charter's "Where the cohort stands" says Watcher's frames "apply in stream order". Replicator applies them in arrival order, guarded by occurred_at >= (POLITENESS.md Applying a policy). The charter's text is cannobserv's, so I didn't touch it.

    For later issues

    • For F1: stop the content.fetch-policy producer watcher#374 (the post-F1 cleanup it triggers):
      • Drop the "until F1" wording at replicator-boundaries.md :65 and in the Producer paragraph, in src/worker/policy.py's docstring, and in POLITENESS.md's "Without one (all of Watcher's frames)".
      • "Watcher's own DEFAULT_MIN_INTERVAL" (replicator-boundaries.md The fallback default, and POLITENESS.md:185) cites a constant Watcher deletes at the jump. Keep it as provenance, but say "was".
      • :208-215 stays as history.
      • The boundaries doc is at 9726 of 10000, so split before adding.
    • For cannobserv (no issue yet): the "stream order" phrasing above. Worth a one-line issue if the coordinator agrees; it needs GH_TOKEN_CANNOBSERV.
    • For gregoryfoster/skills (curating-context, no issue yet): prove-no-loss.sh's index warrant refuses an index line extended to link a doc in another repo. Every sibling that links the charter from its AGENTS.md will hit the same refusal.
    • For [Epic] content.fetch-policy producer moves to Archiver (parked until F1) #135 (the epic): AGENTS.md is 5990 of 6000. Three docs were already over the per-doc budget at e924f97: COMMANDS.md 10378, SKILLS.md 10059 and ENVIRONMENT.md 10014. This change didn't cause that.

    Post-merge host steps (co-replicator)

    1. Land it on main:
      • If merged on GitHub: git -C /home/exedev/replicator pull --ff-only.
      • If merged locally from the main checkout: git push origin main.
      • Then git status -sb must show ## main...origin/main, clean.
    2. No uv sync and no restart. Nothing the worker imports changed, so the service stays on its current build.
    3. Refresh the index, because the manifest description changed:
      • In a Claude Code session whose cwd is the main checkout, run codebase_update.
      • The pre-check, offline and capped by nature: node "$SOCRATICODE_DRIVER" validate-manifest .
      • If you use the driver instead of the MCP tool, use the systemd-run --user --scope -p MemoryHigh=1200M -p MemoryMax=1536M -p CPUQuota=100% choom -n 500 -- cap from docs/COMMANDS.md.
    4. Remove the worktree: git worktree remove --force .worktrees/137 and git branch -d 137-boundaries-charter-parent.
  6. gregoryfoster commented on Oct 19, 2026

    @gregoryfoster
    ContributorAuthor

    Code review round 2 (implementer, 2026-10-19). Corrects the build report above.

    Item Action Result
    5 Fixed c0e781c: round 1's STREAMS.md index tighten said "Bus Conventions in full". That's false, because the cross-stream rules are CONVENTIONS.md's. It now reads "what each stream carries, and why each one-liner here holds", which is STREAMS.md's own opening. The --claims check had passed only because the AGENTS.md atom appears elsewhere in the file.
    6 Fixed 19955ac: the #137 warrant block in context-loss-ok now states the final count, and is reflowed

    Figures now.

    • AGENTS.md is 5991 → 5991 exact, holding the branch-point count. The curation row was amended to 19955ac in 1c53ea4.
    • No-loss: lost 0, 12 warranted, claims dropped 0. Seams 0. Counts 0. No dead links or anchors.
    • uv run pytest: 1421 passed, 1 skipped. Ruff check and format are clean.

    Branch tip 1c53ea4, 9 commits on e924f97, still unpushed. The post-merge host steps above are unchanged.

  7. gregoryfoster commented on Oct 19, 2026

    @gregoryfoster
    ContributorAuthor

    Shipped (implementer, 2026-10-19)

    PR #143 was fast-forwarded to main: e924f97..1c53ea4, 9 commits.

    • The boundaries doc is normative as the Replicator annex to CannObserv/cannobserv docs/BOUNDARIES.md. Its producer statement is phase-aware: Watcher until F1 (watcher#374), Archiver after it, with the payload unchanged apart from the optional generation (cannobserv#566). The rule is linked to POLITENESS.md and src/worker/policy.py, not restated. Commits 67c3888 and 4b4dc48.
    • AGENTS.md links the charter under the boundaries line and holds 5991 → 5991 exact. Twelve class-C tightenings in place pay for it. Commits 300ad55, 37f693e and c0e781c, with ledgers in 8cca88a, 82b0d98, 19955ac and 1c53ea4.
    • The SocratiCode manifest's boundaries-charter description is updated to match.

    Verification

    Post-merge host steps, done

    1. The main checkout is on main at origin/main 1c53ea4, clean.
    2. No uv sync and no restart: no runtime code changed. The service stays on its running build.
    3. codebase_update from the main checkout. The first call was skipped because another session held the index lock. The retry updated 2 files (26 chunks), and codebase_context_search on boundaries-charter now returns the new header and Refs.
    4. The worktree and branch are removed (next step).

    Follow-ups. They're unchanged from the build report; none is filed.

    • The post-F1 "until F1" cleanup belongs to watcher#374. The boundaries doc has 274 tokens of headroom left, so split it before adding.
    • The charter's "stream order" wording is cannobserv's.
    • Two curating-context notes for gregoryfoster/skills:
      • index refuses a cross-repo link added to an existing index line.
      • Short, unscoped tighten entries match later lines as substrings and warrant them silently. That happened to two lines in this change: the Project Layout comma and the Conventions STYLE.md line.
  8. gregoryfoster commented on Oct 19, 2026

    @gregoryfoster
    ContributorAuthor

    Follow-ups filed (2026-10-19).

    Dropped: the cannobserv "stream order" item. On a closer read it isn't a defect. co-core's fetch_policy_supersedes itself answers "stream order" between two unordered frames (src/worker/policy.py:238-242). So the charter states the cohort-level rule correctly. Replicator's occurred_at guard is a stricter local addition, documented in POLITENESS.md, and doesn't belong in the charter. cannobserv#579 already removes that status line at F1.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions