fix(session-start): print the secondmate charter in the context digest - #1157
Open
brchue-ux wants to merge 1 commit into
Open
fix(session-start): print the secondmate charter in the context digest#1157brchue-ux wants to merge 1 commit into
brchue-ux wants to merge 1 commit into
Conversation
A seeded secondmate home carries its charter at data/charter.md, but
fm-session-start.sh never printed it: the CONTEXT digest listed only
projects.md, secondmates.md, captain.md, captain-shared.md, and
learnings.md. AGENTS.md line 3 ("You are the first mate.") is loaded
every session in every home, while the charter that would correct it in
a secondmate home was loaded in none, so a second mate opened every
session announcing itself as the first mate and describing a fleet-wide
role it does not have.
Print data/charter.md first in CONTEXT, in the same delimited form and
with the same explicit ABSENT marker as the files already there. It
answers "who am I", which governs how everything after it is read, and
its absence is meaningful: no charter means a primary home rather than a
secondmate one. Add it to the digest's "do NOT re-read" trailer too.
Add the identity rule to AGENTS.md's address block, and charter.md to
the data/ layout listing in section 2.
The rule is deliberately NOT added to the charter template in
fm-brief.sh: AGENTS.md owns the rule and the charter supplies only the
domain, so there is one copy to maintain and every already-seeded home
is fixed with no per-home edits to gitignored local state.
The CONTEXT digest is composed unconditionally, with no harness or
runtime-backend branching, so this change is independent of both axes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A seeded secondmate home carries its charter at
data/charter.md, butbin/fm-session-start.shnever printed it.The CONTEXT digest listed only
data/projects.md,data/secondmates.md,data/captain.md,data/captain-shared.md, anddata/learnings.md.AGENTS.mdline 3 ("You are the first mate.") is loaded every session in every home, while the charter that would correct it in a secondmate home was loaded in none.The result is a reproduced identity bug: a second mate opens the session announcing itself as the first mate and describing a fleet-wide role it does not have.
Changes
bin/fm-session-start.sh- printdata/charter.mdin the CONTEXT digest, first, beforedata/projects.md.It answers "who am I", which governs how everything after it is read.
It uses the existing
print_file_or_absenthelper rather than a second emission path, so absence prints the same explicitABSENTmarker and stays distinguishable from an empty-but-present file.Absence is meaningful: no charter means this is a primary home rather than a secondmate one.
data/charter.mdis also added to the digest's closing "do NOT re-read" trailer and to the two header comments that enumerate the context files.AGENTS.md- one line in the top address block stating the identity rule, pluscharter.mdin the section 2data/layout listing, one line in the section 3 ABSENT-meaning sentence, anddata/charter.mdin the section 3 context-digest enumeration.The last two are cross-reference updates to existing lists, not restatements of the rule.
The additions are deliberately tight because that file's token cost is paid by every session of every fleet member.
Deliberate non-changes
The identity rule is not added to the charter template in
bin/fm-brief.sh.This is a one-owner-rule decision:
AGENTS.mdowns the rule and the charter supplies only the domain.Duplicating it into the generated charter would create two copies to drift, and would leave already-seeded homes - whose charters were copied at seed time and are gitignored local state - still broken.
The two changes here fix every existing home with no per-home edits, which is a required property of the fix.
No home's
data/charter.mdwas edited.AGENTS.mdsection 1's "only point of contact for all software work across all of their projects" sentence was reviewed and deliberately left alone; that remit wording is tracked as its own separate item.Verification
Extended
tests/fm-session-start.test.shrather than adding a new runner, per the repo's colocated-test rule:test_context_digest_charter_present- content printed, ordered beforeprojects.md, listed in the trailer.test_context_digest_charter_absent-ABSENTmarker, not(present, empty).ABSENTcount moves from 4 to 5, sincecharter.mdis now a sixth context file.bin/fm-lint.shandbin/fm-doc-audience-check.shboth run clean (ok surfaces=55 local_links=151).One pre-existing unrelated failure in that suite,
not ok - MISSING diagnostic did not appear at all, reproduces identically on the base commit b29621b and is not caused by this change.Digest output
Charter present:
Charter absent:
Compatibility
Checked rather than assumed.
The CONTEXT section of
fm-session-start.shis a sequence of unconditionalprint_file_or_absentcalls with no reference toPRIMARY_HARNESSor any backend variable.Harness branching in that script is confined to the supervision-instructions step, and backend reads to the fleet-state endpoint liveness loop; neither gates CONTEXT.
This change is therefore independent of both the harness axis and the runtime-backend axis.