Repository navigation
Give DM peers one typed encoding, fix stale tests, repin native build - #2763
Conversation
Three tests and every fresh native build were red on main. - DM history kept its peer as `str | ThreadTarget` (historical_views.py DMHistory.second, read_basis direct_history and fetch_page, history_views dm_display_page) and re-decoded it with CommandTarget.named, which #2733 (f58e2e3) correctly narrowed to raw strings. Any typed peer, including Toad's retained IncarnationThreadTarget, crashed on removeprefix. The peer is now a ThreadTarget from the boundary in; the re-decode and the redundant require_dm_peer calls are gone, and ThreadViewRead decodes its thread name once. - test_historical_views read bus_files() keys as names; since 1a6fc31 (#2709) the keys are typed file identities and the paths are the member maps. The test reads members through one helper. - test_outbound_transcript_source hand-built RecordedThreadIncarnation from Thread.created_at, which d5cd4bb (#2724) made a CreationTime. The test now asks the owner, Thread.incarnation / recipient.require_recorded(). - f4ca048 (#2748) changed stack/native-turn-context.{mjs,d.ts} without --update-pins, so prepare-pi-native refused every fresh build (and the next install). Repinned: only turn-context.js and turn-context.d.ts move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wners - RetiredCommanderFile is retained bus state its carry consumes: a DurableFile, so every declared root file is durable or runtime again (a012a03, #2743). - The ratchet guard composes owners through Black, so the formatting measure counts nothing and each comparison measures only the classes; 97256db flipped the expectation to status 0 while the fixture stayed unformatted. - bus_files keys are DeclaredFile since #2709: assert the declared owner. - Routes are written owner-only by their owner; the backup reads the saved route through read_active_route since #2731. - The bus-history round trip runs every step the chain orders before the goal-request carry, under the maintenance hold, instead of a hand-picked subset that #2701's claim-field carry fell between. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e1e82d6 (#2684) deleted test_backend._replay_stub and _NATIVE_PROMPT_START; test_native_refusal_recovery.py still imported them for helpers no test calls since e16d8df deleted the fake-backed tests. Collection died on main. The one real test stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
#2764's smoke collection fails in your held Failing job: https://github.com/OpenHCSDev/agent-comms/actions/runs/39951823803/job/120407905294 |
…estating owners - StoreBackup.complete_interrupted gives StoreBackup.interrupted its caller: the install entry finishes and retires any restore a killed install left, under a maintenance hold, before anything reads the bus. - RootFile refuses a declaration that is neither DurableFile nor RuntimeFile; UnfinishedOwnerRename (from #2749) becomes DurableFile. - UnionDecoder.decode_candidates: when no alternative's shape admits the value, the first alternative's own decode states the refusal, so total failure keeps its declared cause again (lost in #2712). - Tests use the owners: DeclaredWireType and RecordMember members in the union test, typed carried paths, a committed GivenThreadText title, and rehearsal buses owned by the installed runtime and read through its CLI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SelectedResponseNotification, CompletedAssignment and the delivered state read activity.progress or call activity's notification methods, yet declared activity as optional; #2450 (69304ca) gave the selected-response override a None default, so a missing activity became an AttributeError instead of the TypeError the call contract owes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
debt-src at 33003fd, every finding: |
The drifted-store case compares typed carried paths, and the installed-entry case decodes the history page messages instead of the unresolvable result shell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2713 (c3bd967) made SessionBridge.pause return one ResumableBridge; the tests still unpacked a tuple. Since #2709 (4cad001) a root belongs to one runtime: session_bridge now publishes its bus to the runtime serving the bridge, and the swap test hands it to the new runtime at publication, as the installer does. SourcePrograms reports its runtime. RootFile.__init_subclass__ annotates its keyword arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # src/agent_comms/installer/upgrade.py # tests/test_install_rehearsal.py
PiReported decodes its value with the external reader, which tolerates keys Pi adds (contextUsage.percent), but _RepresentedDecoder admitted only the exact wire record, so the #2712 union prefilter ruled ReportedContextUsage out and PiOmitted refused the payload. The representation's external admit now derives from its structure's external admit. Also relocks the stack onto toad main, which carries toad #1149. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps main's RegistryStore.digest and the GivenThreadText title in test_interrupted_rollback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
admit is banned vocabulary (debt_ratchet BannedVocabulary), and the new _RepresentedDecoder override added four more sites of it. The whole family in field_codec.py is renamed in this change, and the override now reuses the base check instead of restating its null test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It meets raw wire null from outside, which boundary_decoder declares; the rename touched its line, so NoneAbsence counted the old null test as new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
upgrade() keeps main's command scope and completes an interrupted restore first inside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes the tests that are red on main. Each fix is at the owner of the broken fact, or in a test that was hand-building a shape its owner now declares differently.
Source fixes
DM peer had two encodings (IDEN-3).
DMHistory.second,direct_history,fetch_pageanddm_display_pagetookstr | ThreadTargetand re-decoded the peer withCommandTarget.named. #2733 (0087dc9) narrowed that to raw strings. The peer is now aThreadTargeteverywhere, which fixestest_historical_views::test_normal_comms_api_contains_history_and_execution_stays_live.Union failures lost their cause.
field_codec.pyUnionDecoder.decode_candidates(≈line 2417) skipped every alternative whose shape did not admit the value. When none admitted it, nothing was decoded and the error had no__cause__. This came from the #2712 shape filter (8d9c10e, commit 8b63ca4). Now, when the shapes rule out every alternative, the first alternative's own decode supplies the refusal. Fixestest_union_success_releases_rejected_payload_and_failure_keeps_first_cause.Bus files were declared on bare
RootFile.RetiredCommanderFile(#2743, a012a03) andUnfinishedOwnerRename(#2749, a1aab88) were neither durable nor runtime files, so install behaviour for them was undefined. Both are nowDurableFile.RootFile.__init_subclass__(locked_store.py) refuses any new declaration of that kind, which fixestest_bus_files::test_every_bus_file_is_a_declared_root_file.StoreBackup.interruptedhad no caller. It came from #2709 (27e8722). A newStoreBackup.complete_interruptedfinishes and retires any restore that a killed install left behind, under a maintenance hold.upgrade()calls it first, before anything reads the bus. Fixes both cases oftest_interrupted_rollback.Activity was declared optional where it is required.
assignment_states.py:SelectedResponseNotification.notificationreadsactivity.progress, but #2450 (f9958d7, commit 69304ca) gaveactivityaNonedefault. A missing activity therefore failed with anAttributeErrorinstead of the call'sTypeError. The completed and delivered states had the same type. All three now requireAssignmentActivity. Fixestest_historical_notifications::test_recorded_engagement_is_not_an_active_turn.External Pi records were refused by the union prefilter.
field_codec.py_RepresentedDecoder.fits_external(new, besidefits_wire):PiReported.from_wiredecodes its value with the external reader, which tolerates keys Pi adds (contextUsage.percent), but the representation admitted only the exact wire record. The #2712 prefilter (8d9c10e; bisected: the payload decodes at 8d9c10e^1 and fails at 8d9c10e) ruledReportedContextUsageout, andPiOmittedrefused the dict. The representation's external shape check now derives from its wire structure's. The codec'sadmits_*shape checks are renamedfits_*in the same change, because "admit" is banned vocabulary in the debt ratchet. Fixestest_installer_test_runtime::test_checkout_native_tests_use_a_private_runtime(inner:test_native_input_bus_path::test_saved_owner_dm_replies_and_core_reads_exact_native_proof).RootFile.__init_subclass__is annotated (**kwargs: object), so debt-src's TypeErrors and UnannotatedParameter counts forlocked_store.pystay at the base's.Test fixes (each test now uses the owner's declaration)
test_attach_only_reads_original_roots_and_rejects_changed_snapshot:bus_fileskeys are typed since Integration batch: duplicates 5-8, root runtime owner, interrupted rollback, installer file identity #2709 (1a6fc31). The test now reads the member paths.test_frozen_unhandled_delivery_projects_recovery_without_claiming: usesThread.incarnationinstead of rebuilding it from aCreationTime(Move Pi payload and transcript decisions into their owning families #2724, d5cd4bb).test_debt_ratchet(4 node ids):module()helper formats the composed owners.test_bus_files(parameterized pair): asserts theDeclaredFilekey (Integration batch: duplicates 5-8, root runtime owner, interrupted rollback, installer file identity #2709).test_store_backup(both cases): writes the route owner-only, as its owner does. Keep rollback state readable by the outgoing runtime; stop union admits recursion #2731 (699a5f6) refuses a non-private route atactive_route.py:216.test_carry_bus_historyround trip: runs every step that the chain orders beforeOwnerRequests, under a hold. Integration batch two: owned dispatch, closure state, field directives, retained waits, install speed, import tax #2701 (d5eac7a) insertedClaimFieldsbetween the steps the test had picked by hand.test_carry_dead_turns: carried paths arePathsince ded6cdd (Integration batch: duplicates 5-8, root runtime owner, interrupted rollback, installer file identity #2709).test_interrupted_rollback:editing()requirescommit()since 8e11c30).GivenThreadText.test_native_refusal_recovery: deleted the orphaned helpers that imported_NATIVE_PROMPT_START, which Batch round r2: nine ready heads, merged and tested once #2684 (e1e82d6) removed fromtest_backend.test_field_codecunion test: the test's members hand-wrotefrom_wire,to_wireandschema. A member inheriting a union's wire structure recursed inadmits_wireonce Reject impossible union wire shapes before decoding candidates #2712 started calling it. The members now inheritDeclaredWireTypeandRecordMember, which Keep rollback state readable by the outgoing runtime; stop union admits recursion #2731 and the codec declare for exactly this.test_install_session_bridge(4):bridge.pausereturns one value since Port typed bridge resume outcomes and owned MRO handler lookup #2713 (ded2d7b, commit c3bd967). The tests unpacked a tuple. The swap test hands each prefix's bus to that prefix's runtime withRootRuntime.publish, as the installer does (Integration batch: duplicates 5-8, root runtime owner, interrupted rollback, installer file identity #2709).source_programs.runtimederives the runtime from its prefix.test_install_rehearsal:ForeignRuntimeError,root_runtime.py:32).installed_commsnow publishes the bus to the installed runtime, and the history is read back through that runtime's own CLI.Elsewhere
ViewKind, which Integration: kind families, thread-name owners, disclosure mixins, Pi event phases, phase evidence, commander package #2695 (a6a44e7) deleted. Fixed in Build the saved view from its declared family member toad#1149 (merged). This PR relocksstack/uv.lockonto toad main (336cf3e), which contains it.Environment, not product
TestHome.uv's declared contract (installer/practice.py:86), and those cases pass with uv on PATH.test_install_rehearses_without_changing_the_busunder the default basetemp: it fails with "Insufficient free space before building the practice copy" when/tmp(tmpfs) has less free space than the 5 GiBStorageRulefloor. It passes with--basetempon/var/tmp.Still red, owned by the install-23 fix
test_install_rehearsal:test_failed_publication_restores_absent_route_without_store_changesand[retained-bus]were hidden behindForeignRuntimeErrorand now reach the live carry. There, livereconcile-stores(upgrade.py:955) rewritesbus.sqlite3, whileplanned-reconcile(upgrade.py:985) planned no rewrite.RehearsalFiles.require_rehearsalthen refuses: "Live carries changed files absent from rehearsal: bus.sqlite3". This is the same defect that made install 23 refuse. The fork fixing install 23 owns it in its own PR and uses these tests as its reproduction.Proof
All touched test files pass locally (
-p no:xdist, this worktree'ssrconPYTHONPATH, uv on PATH). The native pin moved separately in #2766 (f3f069f).🤖 Generated with Claude Code