Repository navigation
Ezri's violin skill: a lesson gives it to her, exercises it each round and grades what she plays by ear (S2b, L6a) - #2032
Merged
Conversation
…e L6a slice plan (AD-1378 S2) The Architect's cite check of section 13 against S2a as merged (origin/main 6b30f77) found that the skill machinery could not be built as written. It is recorded as A140 (a to n), and the passages it touches are corrected in place or extended: section 13's first five bullets and L6b's writer bullet, D21 (4), sections 14, 15, 16, 17, 18 (a step 8), 24 (item 13), 26 and 27 (a "Revision 2t" subsection). - The qualifying phrase key is twinkle-phrase-1 (the label "Twinkle, phrase 1"), not twinkle-1. - The test grades only the record a close hands it (LessonAtClose), never a search, and answers inconclusive for any other caller, because the weekly drift run and /qualify run every registered test. - The chain runs at one site, the end of _LessonBeats._commit, through a SkillHooks seam (opened, round_completed, closed) and a skills= keyword on LessonService; neither class gets a method, both being at the srp-size limit. A _commit task that is itself cancelled stops at the await it is in: its hooks run at most once and nothing retries them. - acquire_skill is called only when she holds no record, because it resets one. - summary.qualification gains an error code and is written by a second rewrite of the closed record. - L6b's one writer is the closed hook. L6a is two milestones: L6a1 (no lesson.py edit) and L6a2 (the hooks). Mutation rows Z54 to Z70 are new. The claims check of this revision (four rounds, a warm reviewer on gpt-6.1-sol, and the Architect's decision at the round-three brake: continue, Design: holds) found nine wordings of its own text too wide or too narrow and all were corrected; its last round was READY with no size finding. Text only. Refs #1935 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…L6b slice plan (AD-1378 S2) The Architect's cite check of section 13's L6b bullets (the proven skill as nature across a reset) against S2a as merged (origin/main 6b30f77) changed its design in five places. It is recorded as A141 (a to j), and the passages it touches are corrected in place: section 13's L6b bullets, D23, P19, section 1 (item 6), A140 (f), (j) and (l), sections 14, 15, 16, 17, 24 (items 14 to 16), 26 and 27 (a "Revision 2u" subsection). - No public reader says which model an agent's runs used, so every ledger row's model is null, every successor is commissioned at FOLLOW (by commission_from_nature, in _wire_lessons), and her first complete pass restores the proven level through one update_proficiency, because the bridge raises a level by one at most. Nothing holds her level at boot in this slice; a model reader and a same-model branch are a follow-up. - The re-qualification state is worked out from the ledger at that pass and is not held in the service; start_check.nature is dropped (the lesson record is published whole in her Ship's Records entry), so L6b edits no line of lesson.py. - The ledger is an append-only JSONL file written through asyncio.to_thread under a threading.Lock; a torn tail line is ended before the next append. - --clean-slate clears skill-nature/ through one tuple, _NATURE_DIRS, that every nature site iterates (procedures first, the marker first). - Nature comes only from the ledger, never from qualification_results.db or a lesson record. - L6b is two milestones: L6b1 (the ledger, the reset, the census) and L6b2 (the writer, the reader, the wiring). Z44 is redefined and Z71 to Z83 are new. The claims check of this revision (three rounds, a warm reviewer on gpt-6.1-sol) found four wordings of its own text too wide or too narrow (A140 (i) and (j) did not yet say what the restoration does to error and level_after; the harness database is qualification_results.db; one twin listed causes instead of pointing to A140 (i)) and all were corrected; its last round was READY with no size finding. Text only. Refs #1935 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…apter (AD-1378 S2)
The first half of L6a (contract A140): everything the lesson loop will call at its three moments, built and registered, with no change to the lesson service (L6a2 wires the hooks).
- skills/violin/qualification.py: ViolinByEarQualification (a tier-2 harness test, threshold 1.0) grades only the lesson a LessonAtClose hands it, so the weekly drift run and /qualify, which hand a test another runtime, get an inconclusive result with a fixed error and capture no baseline. grade and by_ear_attempts count her by-ear attempts (rounds[i]["attempt"] only: never a retry, the model's block or the retention take) on the phrase key twinkle-phrase-1 ("Twinkle, phrase 1"), of this agent and this crew's timeline, in a lesson no restart ended: three in a row with every note right and the onsets inside 60 and 120 ms pass.
- skills/violin/skill.py: VIOLIN_BY_EAR (an acquired skill, decay 90 days) and ViolinSkillChain. opened gives her the skill at FOLLOW, by mentoring, only when she holds no record (acquire_skill resets one); round_completed records one exercise; closed reads its record once into a strict JSON snapshot, grades it through the harness and lets the bridge move her level at most one, and answers the contract's summary.qualification (name, passed, score, level_before, level_after, lesson_id, take_ids, timeline_id, at, error), with a fixed error code (not_run, not_graded, skill_not_updated) and never an exception's text. A hook never raises; a cancellation passes through every one.
- runtime.py and startup/finalize.py: qualification_harness and qual_skill_bridge as read-only properties (and _qual_skill_bridge set to None in __init__), and _wire_lessons registers the skill, the test and its mapping on every start (one INFO line; a failure is one WARNING and lessons still wire). Making qualification_harness public also hands the two holodeck wirings the harness they already read; both flags are off on the vessel.
- tests/test_ad1378_s2b_skill.py: 165 tests through the real registry, skill service, qualification store, harness and bridge.
Review: five rounds by a warm reviewer on gpt-6.1-sol (Size findings 0), and two Architect decisions at the round-three brakes (Design: holds, continue both times): closed reads its record exactly once into a snapshot, and the snapshot is strict JSON (allow_nan=False). Hand mutants: 77 of 77 killed. The findings recorded and not repaired (a registered-test dict iterated across awaits in the harness, stores that leave connections to the collector, two reads of one id in grade, the harness emitting after it saves) go to the S2b follow-up issue.
Refs #1935
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…1378 S2) The second half of L6a (contract A140): the lesson service gives the chain that L6a1 built its three moments, and the wiring gives the service the chain. - skills/violin/lesson.py: SkillHooks (opened, round_completed, closed) and LessonService(..., skills=None). The hooks run at the one site that writes a move, the end of _LessonBeats._commit, after the record, the Ship's Records entry, memory, lesson_changed and the take marks, under the service's own lock, through the module function _after_commit_skills: opened for the move that opens a lesson, round_completed for each round a move completes, closed for the move that closes it, whose answer is written into the closed record as summary.qualification by one more write of the record through _persist_lesson, with no event. Each hook runs on its own (_run_hook) on its own deep copy: one that raises is one ERROR naming the lesson and the hook, and neither undoes the move nor keeps the next hook from running, so a close that a retry's completion applies (one move: its exercise, then its qualification) is still graded when the exercise fails. A cancellation passes through every hook. Without skills the service writes what it wrote before, byte for byte. No method is added to LessonService or the beats class (both stay at 15; the beats class is 472 lines). - startup/finalize.py: _wire_lessons builds ViolinSkillChain when the runtime has a skill service (the harness and the bridge, or None for a part it lacks, and the service's own timeline) and passes it as skills=. - tests/test_ad1378_s2b_skill.py: 31 tests added (196 in the file), through the real lesson service over a real recording store, the real chain, skill service, harness and bridge: acquisition once, one exercise per completed round, the close's one advancement through the bridge, the summary written and kept through a later removal, the held-back close, the expiry close, a cancelled End, a cancelled commit task (never retried), a restart close never graded, a raising hook at each moment, a hook that changes its argument, the plain service unchanged, the wiring and the whole vessel. Review: two rounds by a fresh reviewer on gpt-6.1-sol (Size findings 0). Round 1 found that one try around the three hooks let a failing round hook keep a held-back close from being graded; each hook now runs on its own and a test covers the combination. My hand mutants: 34 of 35 caught on the repaired candidate (the survivor, the hooks running before the take marks, changes nothing observable short of a cancellation and goes to the S2b follow-up issue). Refs #1935 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…o the S2b L6a branch Refs #1935 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Dec 2, 2026
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.
Refs #1935
What changes
When the Captain teaches Ezri a phrase by ear, she now holds a skill for it, each completed round exercises it, and a lesson that ends with three right by-ear attempts in a row grades her and moves her up one level. It rides on S2a's lesson service and is off wherever lessons are off (the lesson wiring is where all of it is registered), so merging it changes nothing for a vessel that has not enabled lessons.
violin_by_ear("Violin, by ear") is a registered acquired skill with a 90-day decay rate. The first lesson she has gives it to her at FOLLOW by mentoring; a later lesson never gives it again, becauseacquire_skillis an upsert that resets a record's level and its exercises (it runs only when she holds no record, a suspended one included).ViolinByEarQualification, tier 2, threshold 1.0). It grades one thing: the record of the lesson that has just closed. An attempt counts when it is her by-ear attempt of a round (never the retry, never the model's, never the retention take), measured against that lesson's phrase beat, with a take, no note errors (wrong, missed or extra notes), a median onset error within 60 ms and a largest within 120 ms. Three such attempts in consecutive rounds pass; the score is the longest run over three. It grades only a closed lesson of this vessel's current crew, for her, that a restart did not end, and whose label gives the phrase keytwinkle-phrase-1. Registering a test also enrols it in the weekly drift run and in/qualify, which call every registered test with the runtime and no lesson: for those the test answers an inconclusive result with a fixed message, so no baseline is captured and drift statistics leave it out (BF-711).ViolinSkillChain,skills/violin/skill.py).openedgives her the skill;round_completedrecords one exercise;closedruns the test, asks the existing qualification-skill bridge once (it moves her at most one level) and answers a ten-key summary. It reads the lesson record once, into one strict-JSON snapshot; a failure at any step is logged and never raises, and the answer names a fixed code (not_run,not_graded,skill_not_updated), never an exception's text.LessonService(..., skills=None)takes the three hooks (SkillHooks);Nonemeans none runs, and the service then writes byte for byte what it wrote before. They run at the one site that writes a move, the end of_LessonBeats._commit, after the record, the Ship's Records entry, memory, thelesson_changedevent (when the move announces) and the take marks, under the service's own lock:openedfor the move that opens a lesson,round_completedfor each round a move completes,closedfor the move that closes it. Each hook runs on its own, on its own deep copy of the record: one that fails is one ERROR naming the lesson and the hook, and neither undoes the move nor keeps the next hook from running (a close the Captain's End held back until her retry completed is one move: its exercise comes first and the close is still graded). The close's answer is written into the record assummary.qualificationby one more write of the closed record, with no event. No method is added toLessonServiceor to the beats class._wire_lessonsregisters the skill, the test and the test's mapping to the skill on every start (each is an upsert), builds the chain when the runtime has a skill service (without the harness or the bridge a close is simply ungraded), and gives it to the service. The runtime gains two read-only properties,qualification_harnessandqual_skill_bridge. Makingqualification_harnesspublic also hands the two holodeck wirings (_wire_holodeck_team_simulations,_wire_holodeck_scenarios) the harness they already read withgetattr(runtime, "qualification_harness", None): both of their flags are off on the vessel (the Architect read them off itsconfig/system.yaml), and a vessel that turns them on would now get a harness where it gotNone.prompts/ad-1378-s2-the-lesson-loop.mdis now revision 2u: the A140 and A141 rows record the Architect's cite checks of this slice and of the next (the proven skill as nature across--clean-slate), and its text was claims-checked by a second model.What the Captain should know
twinkle-phrase-1) for a lesson to qualify; he types the label (the Lessons tab's start form leaves it empty). A hint beside the field is on the follow-up list.summary.qualification(its level before and after, the three take ids and a fixed error code when something failed) and in the harness's history; the HXI shows neither yet.--clean-slate. This PR gives her the skill and a way to earn levels; the next one (L6b) makes the proven level part of what a successor is born with. The Architect found that no public reader says which model an agent's runs used, so L6b commissions every successor at FOLLOW from a ledger and lets her first passed by-ear lesson restore the proven level. Nothing here depends on it.One new test file,
tests/test_ad1378_s2b_skill.py(196 tests, real components overtmp_path); no existing test, fixture or generated baseline changes.What this does not claim
Review and proof
Diff Reviewer rounds on
gpt-6.1-sol(pinned on every call and checked against the session log), my own hand mutants of each milestone, and Architect decisions at the round-three brakes, recorded on #1935. Each milestone was committed only on a READY verdict with zero Size findings.The two Architect decisions on L6a1: after three rounds of findings with one cause (the adapter read one record at six independent sites),
closedreads its record once into a snapshot and everything after reads the snapshot; and the snapshot is strict JSON (allow_nan=False, as the Ship's Records entry is), with the strict round trip's coercions accepted and error results that the harness stores without lineage exempt from "the answer equals what was stored".scripts/run_test_gate.py) on the committed treeb6bde2ae(the merge ofmainat374c7d61included; receipt exit 0 with the tree unchanged): preflight (config reference, profiles and facade, AD ledger, seam contracts, architecture fitness 93 / 0 / 30 / 13, store registry, compileall), then 59,800 passed, 174 skipped, 0 failed (59,974 collected, 59,974 run) in 53 min 8 s on 12 workers, none lost; temp volumeC:. The gate waited 20 minutes for a quiet moment because another lane's tests were running; no test of mine ran while it did.b6bde2ae(run 46968541276, 2026-12-02): python-tests-shard (1) 12 min 29 s, (2) 15 min 31 s, (3) 12 min 8 s, ui-tests 5 min 30 s, desktop-tests 17 s, discord-adapter-tests 1 min 4 s.