docs(6205): inception and family comments drop record, milestone and date citations

inception states the legacy stamp and the retired rulebook keys as facts
about stored records; family keeps the repeat-trigger calibration numbers
without the date and record they were measured on, and drops the instance
that taught the per-kind comparison.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 20:29:03 -04:00
co-authored by Claude Opus 5.5
parent 5f96545ae1
commit dd4bc234e9
2 changed files with 26 additions and 30 deletions
+14 -17
View File
@@ -1,4 +1,4 @@
"""Family canon's promotion engine (milestone 463 step 3).
"""Family canon's promotion engine.
A family idea moves between three states — candidate, canon, retired — and
every move is a decision with a reason, written to `family_decisions`. No
@@ -62,7 +62,7 @@ logger = logging.getLogger(__name__)
#
# These are what an evaluation is judged against, on every install. They live
# here — and in the tool docstrings that quote them — rather than in any
# instance's rulebook (rules 115, 119).
# instance's rulebook, so every install judges by the same text.
CRITERIA = (
{
@@ -97,13 +97,11 @@ CRITERIA_KEYS = tuple(c["key"] for c in CRITERIA)
TRIGGERS = ("citation", "repeat", "milestone")
# The repeat trigger's similarity floor. MEASURED, not guessed (2026-10-06,
# #4989): against a description of one pattern known to have been built four
# times in four projects, the records that implement it scored 0.79-0.82, and
# the best match in a project that never built it scored 0.65. A trigger only
# opens an evaluation, so a false positive costs one judgment, not a wrong
# promotion. Step 5 measures the cross-language threshold against known pairs
# and supersedes this.
# The repeat trigger's similarity floor. MEASURED, not guessed: against a
# description of one pattern known to have been built four times in four
# projects, the records that implement it scored 0.79-0.82, and the best match
# in a project that never built it scored 0.65. A trigger only opens an
# evaluation, so a false positive costs one judgment, not a wrong promotion.
REPEAT_THRESHOLD = 0.80
# Words that say a citation is the SOURCE of a pattern rather than background.
@@ -119,12 +117,11 @@ _LINEAGE = re.compile(
_LINEAGE_WINDOW = 80
# Note kinds the repeat trigger compares: recorded knowledge and shapes, not
# the to-do list — and each only against its own kind (#5130). A repeat is the
# same KIND of thing made twice: two shapes built, or two ideas written down.
# the to-do list — and each only against its own kind. A repeat is the same
# KIND of thing made twice: two shapes built, or two ideas written down.
# Across kinds the score stops meaning that. One chunk of a long narrative
# note that mentions a shape's vocabulary scores like the shape itself: a
# dated release log matched a signed-APK CI snippet at 0.83, above this
# trigger's floor, and opened the log as a candidate. The cross-kind relation
# note that mentions a shape's vocabulary scores like the shape itself — above
# this trigger's floor — and would open the note as a candidate. The cross-kind relation
# that IS real — code built from an idea written elsewhere — has its own
# routes: the citation trigger when the lineage is named, and the shape ledger
# once the idea is canon.
@@ -172,7 +169,7 @@ async def _topic(session, user_id: int, topic_id: int | None, *, rules: bool) ->
async def _snapshot(session, idea: FamilyIdea | None) -> dict | None:
"""The idea's state, as a decision's before/after. Slugs, never ids: an id
inside JSON cannot be remapped by a restore (the #3182 trap)."""
inside JSON cannot be remapped by a restore."""
if idea is None:
return None
return {
@@ -219,7 +216,7 @@ async def get_idea(user_id: int, note_id: int) -> dict | None:
"platforms": await _platform_slugs(session, note_id),
"topic": await _topic(session, user_id, idea.topic_id, rules=True),
"adoptions": counts,
# Brief: the history is read in bulk; the full rows are list_decisions (#5131).
# Brief: the history is read in bulk; the full rows are list_decisions.
"decisions": [d.to_brief() for d in decisions],
"undoable_decision_id": _undoable_id(decisions),
})
@@ -478,7 +475,7 @@ async def propose(
Idempotent: an existing idea comes back unchanged and nothing is logged —
a trigger firing on every edit of a record must not grow the log. Write-
gated on the note: an idea is state on someone's record (rule 78).
gated on the note: an idea is state on someone's record.
"""
if not (reason or "").strip():
raise ValueError("a proposal needs a reason — what makes this a family idea?")