Skip to content

Acquire display identities and relationship inputs through their declared owners - #3607

Closed
trissim wants to merge 42 commits into
mainfrom
work/frame-baseline--P954
Closed

trissim wants to merge 42 commits into
mainfrom
work/frame-baseline--P954

Conversation

@trissim

@trissim trissim commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

P954 — Core 49 files, +2,026/−571; paired Toad 15 files, +453/−170

Core head: a6eb302725e834321542454737b339366b276bea.
Paired client: OpenHCSDev/toad#1361, 2b424f78ff9e5ca77d910099b254ff8229d06925.
Both refs equal local HEAD on readback. Both PRs are MERGEABLE. Main was integrated by history-preserving merges; no rebase, reset or force push. Foreign untracked src/agent_comms/skills/refactor-audit/ is untouched.

This is a published source repair, not matched typing, runtime, installation or performance acceptance. New exact-head hosted runs were triggered by both pushes: Core41108145637 and Toad41108153918. At the later readback Core ready/base/review-verdict/native-scripts/debt-tools passed, debt-src was running, and smoke/install-rehearsal were skipped. Toad NRA failed while suite was running; no collected/passed counts were yet available. The failed job reports +2 missing new HistoryViews factory errors in conversation_kind.py and +6 missing ThreadPresence.views errors in thread_comms.py against Core main. Full failure log is retained as p954-sync-46615-toad-gate.log. Toad CI resolves Core main, not this paired Core head, so it cannot establish matched-pair qualification. Core auto-merge is disabled while the pair awaits review. This pair must not land one half independently: earlier client-only landings required reversions.

gave a null member a name
forgot to give it the behavior
the type checker declined the empty chair

Current-main integration and rejected lookup ownership

Merged fetched Core main d249be4d89dc44b7ca03c01d9b484ab05de4232a and Toad main c72556c285cde225a1ab63ba9ad1762f03852ddf, without conflicts. Read the automatically combined FieldCodec, presentation, registry-store and metaclass hunks. Toad retains main's KeyFamilyMeta(FamilyMeta, KeyDeclarationType) fix; no second metaclass implementation. Both fetched mains are ancestors of these heads. Remote refs equal both HEADs; tracked trees are clean.

The retained rejection describes a shared _lookup_names dictionary that is already deleted on this branch. Current ThreadRows.__setitem__/__delitem__ mutate only _rows (registry_document.py:464–470); copied() copies that dictionary (:528–533); lookup_names() builds a fresh MappingProxyType from this cut's births (:501–507). RegistrySnapshot.lookup_names caches only its own frozen rows (:1217–1218). There is no shared mutable lookup dictionary to detach, and no _captured copy on ordinary data writes. The replaced captured()/by_lookup path stays deleted; alias-aware raw-membership refusal is owned by RegistryNames.require_canonical before the row read (registry_provenance.py:188–195).

Source evidence: git grep -n -E '_lookup_names|ThreadLookupIndex|\\.by_lookup' -- src tests tools returned no matches (rc1) across the tracked Core tree. Retained NRA map plus nine post-merge production modules/352 classes/zero parse omissions. Dynamic/local/external resolution remains OPEN. Integration must still execute old-empty-cut/add and unprimed-nonempty/delete/rebirth with both lookup priming orders, checking keys/length/contains/getitem against each cut's own frozen rows. Source inspection is not that execution.

Earlier repair: order63 and the person/history send-back

Four convenience wrappers → two view factories

HistoryViews.dm_display_view and channel_display_view construct actual HistoryView members. Callers choose .page(presentation, bounds=...) or .reading(presentation) themselves. The four *_display_page / *_display_reading wrappers and their string/getattr callers are removed. The retained AST migration converted 80 calls in 21 files; embedded subprocess source and remaining dynamic callers were migrated separately. No compatibility wrappers.

Tag inclusion belongs to ThreadMembership

ThreadMembership.carries(tags) owns tag inclusion. MemberActivityDisplayScope.includes_participant and RegistryProvenance.same_tag_membership consume it. The captured tag relation remains lazy; no eager person/birth/goal roster or replacement SQL schema.

Ordinary thread-local handles versus retained presentation cuts

Main's P958 reader architecture is retained: StoredBusReader.observing uses SQLiteReader.reader_snapshot; OpenSQLiteReadConnection retains its cross-thread-finalization opt-out while queries remain thread-local. StoreContention.configure, LendingConnection and cursor retirement remain.

A long-lived presentation must not borrow the acquiring worker's pooled transaction: a subsequent ordinary read on that worker would otherwise see its old cut. BusReader.captured_reading declares that distinct lifetime. StoredBusReader opens an independent read-only snapshot with check_same_thread=False, closes it with the captured lifetime, and never installs it into SQLiteReaders. An existing BusSnapshot retains itself. BusPresentation.reading retains that source through its existing ExitStack and CapturedBusPresentation RLock. MessageBus.capture_selection owns the common selection load for ordinary and captured reads.

The temporary high-level check_same_thread plumbing is deleted after integrating P958; the option remains at the actual SQLite boundary. SQLiteStorage.read_snapshot and RoomLedger._open_reader retain the compatible keyword contract, query-only configuration and close-on-error behavior. No second pool, worker, queue or cache.

Complete person-row family

ThreadPresence.views declares a typed sequence of complete ThreadViews: the absent member inherits the empty answer, and ThreadView supplies itself. Shared sort behavior remains declared on the parent. Relationship identity revalidation, availability, all three Toad person-row consumers and their existing controls call the family instead of inferring a ThreadView from generic Self on ThreadView | NoThreadView. No isinstance, hasattr, cast or client union narrowing. NoThreadView remains distinct from a genuine cached-model-miss None.

Preserve main's integrated history loop

The complete main traversal loop is retained inside the captured-archive lifetime: one cached live_follows query, initial page/revision, each continuation's remaining budget, HistoricalSourceChanged refusal, traversal append and one final MessagePage.combine. The introduced walrus None walk and repeated combine are removed. _source_page still stamps the original captured catalogue revision once, including empty and archive-to-live fallback pages; _select_source_page receives the same live_follows callable. Original catalogue validation still happens around each page, not on idle retirement.

Earlier overhaul retained

One row owner, not parallel maps

ThreadRows keeps one dict[str, ThreadRow], not _raw, _decoded, _captured and _lookup_names. Immutable ThreadRow owns original raw JSON, binding and lazy projections. WrittenThreadRow carries an assigned Thread; bound=replace and cached_property own their work. Copy/reuse retain unchanged rows without sharing a mutable name map. Unknown/nested wire JSON is preserved until assignment; pickle reconstructs lazy bound rows. Births use the existing ThreadBirthRecord/FieldCodec declaration, not an invented schema or eager full Thread acquisition. First lookup still walks births; no O(changed) claim.

RegistryNames.registered owns alias-aware membership. ThreadIncarnation.require_current owns strict current-peer resolution; tolerant history remains separate. ThreadName.require owns its charset and refusal. FieldCodec.recorded_fields owns the projection mapping. Manual descriptor-cache writes and exception-as-presence paths are deleted.

Bounded immutable relationships

MessageInput acquires the original global latest512+1 relationship window before filtering. Ordering/overflow/eviction, role exclusions, latest sequence/time, exact body[:240], notices, aliases, active goal mentions and stale diagnostics remain. Frozen RelationshipInputs supplies one retained enumeration, selected incarnations and one archived roster from the same cut. Groups receive complete immutable entries/contexts, never placeholders or frozen-child mutations.

Lightweight display is not original-record copying

BusCapability._joined owns offsets, declaration-derived LEFT JOINs, cursor lifetime, required capability decoding and causal malformed-row refusal. Lightweight Message pages and full BusRecord stored history supply only their real query/table/kind differences. Original history copying, frozen audiences and disclosed-answer closure remain full-record operations. No INNER JOIN skip, per-row fallback, compatibility history_record or second codec.

Captured archive lifetime

HistoryArchive.captured retains original DocumentBytes revision and source tuple. CapturedHistoryArchive inherits traversal behavior and owns only those retained values. HistoryView.reading closes over that archive and original bus presentation. Replacing/attaching a catalogue after capture refuses on the next page rather than silently adopting a newer catalogue. Empty/missing catalogue and fallback paths carry the original revision.

Paired Toad lifetime and source integration

WirePageBuffer/SavedHistory retain lazy WireReading through registered PreparationScope ownership. PageEnd uses the retained callable: newest8, older40. WireScope prefixes borrow independently; growth replaces only the main cut; hidden tabs park. Existing admitted preparation tasks/four-thread resource limits own off-UI retirement and shutdown. RLock serializes acquire/use/close; retirement failure reports and re-raises. Native ReusedPrefix remains separate from wire borrowing. No renderer/preparation/geometry cache redesign.

Main's P993 batching is preserved in WireSource.prepare: it consumes page.message_evidence(), not the deleted per-message evidence_for. Main's required CoordinationAccess is retained in the merged controls.

The obsolete read-ahead monkeypatch is deleted: it patched a deleted wrapper and waited on an unincremented counter. Existing control now checks real retained scope/reading, earlier fragments, scrolling and preparation reuse. It does not assert the old ≤3 Core-read bound. The integration owner explicitly accepted measuring that bound at the actual consumer. All author controls remain UNRUN.

Source evidence and exact qualification gap

  • Checkpoint ff5e9d00aa (26 files, +314/−154) and Toad 4f6ef51ef (6 files, +57/−39) were pushed and read back before merging.
  • Resolved Core conflicts: bus.py, historical_views.py, locked_store.py, store_files.py. Toad conflict: test_conversation_kind.py. Subsequent fresh-main merge completed without conflict.
  • Earlier order63 AST parse: 52 Core / 15 Toad changed Python files, zero syntax omissions. Latest main-integration source slice: nine production modules/352 classes/zero parse omissions, retained in p954-sync-46615-map.json. Both git diff --check calls passed. No checker, test suite, project import, build, app, provider, service, install or profile was run by the author.
  • NRA source evidence uses ModuleSyntaxIndex and build_class_family_index, not a local gate. Retained pre-migration map: 74 modules/620 classes/zero omissions. Merged production slice: 18 modules/485 classes/zero omissions. Dynamic/local/external binding remains OPEN; AST is not a runtime proof.
  • Historical passing controls and earlier hosted failures are retained in existing scratch logs, not represented as current-head qualification. Previous Toad41101360019 failed collection (exit4, widget_actions.py:29 metaclass conflict) against unmatched Core0ba2f817; no behavior ran. New Core debt-src and Toad suite were still in progress at readback; Toad NRA failed against unmatched Core main. Debt-src green and matched behavior are not claimed.
  • Root still owes matched Core/Toad typing and combined controls: alias/rebirth/raw/malformed/copy/pickle/tag/unread parity; original full-record copying and malformed required capability refusal; original/empty/missing/attached catalogue traversal; captured handle isolation from ordinary reads; worker-switch/cancel/retire/shutdown; independent/nested prefixes and hidden warm tab returns; actual read-count bound.
  • Root owns authentic saved-cut replay and actual installed frontend acceptance. Retained baselines are not current parity or speedup. No p99.9/frame/history-opening improvement is claimed.

Assumed: AST, publication and mergeability do not prove execution. The new captured lifetime and typed person sequence require matched qualification. The actual consumer must measure the ≤3 read bound. The native paired relation/retirement handoff remains owned by the commander; no holder transfer is inferred from notifications. P954 remains OPEN.

@trissim
trissim marked this pull request as ready for review October 29, 2026 17:03
Copilot AI balanced review requested due to automatic review settings October 29, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

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.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

debt-src at 268f46a, every finding:

grew ClientTypeErrors:batrachian-toad/src/toad/conversation_kind.py +2: this change removes or changes an agent_comms name that client file uses; run mypy on it to see which
grew ClientTypeErrors:batrachian-toad/src/toad/widgets/thread_comms.py +3: this change removes or changes an agent_comms name that client file uses; run mypy on it to see which
::warning file=src/agent_comms/bus.py::GodClassExcess +5 (warns, never blocks)
::warning file=src/agent_comms/field_codec.py::GodClassExcess +39 (warns, never blocks)
::warning file=src/agent_comms/thread_creation.py::LintFindings +1 (warns, never blocks)
found ClientTypeErrors:batrachian-toad/src/toad/conversation_kind.py at batrachian-toad/src/toad/conversation_kind.py:186 ("HistoryViews" has no attribute "channel_display_page"; maybe "channel_display_view"?  [attr-defined]) batrachian-toad/src/toad/conversation_kind.py:272 ("HistoryViews" has no attribute "dm_display_page"; maybe "dm_display_view"?  [attr-defined])
found ClientTypeErrors:batrachian-toad/src/toad/widgets/thread_comms.py at batrachian-toad/src/toad/widgets/thread_comms.py:49 (Item "NoThreadView" of "ThreadView | NoThreadView" has no attribute "thread"  [union-attr]) batrachian-toad/src/toad/widgets/thread_comms.py:209 (Item "NoThreadView" of "ThreadView | NoThreadView" has no attribute "thread"  [union-attr]) batrachian-toad/src/toad/widgets/thread_comms.py:221 (Item "NoThreadView" of "ThreadView | NoThreadView" has no attribute "thread"  [union-attr])
found LintFindings:src/agent_comms/thread_creation.py at src/agent_comms/thread_creation.py:73 (UP040 Type alias `RequiredCreationTime` uses `TypeAlias` annotation instead of the `type` keyword)

@trissim
trissim force-pushed the work/frame-baseline--P954 branch from 3e412d3 to 52f6a3b Compare October 29, 2026 19:27
@trissim
trissim force-pushed the work/frame-baseline--P954 branch from 5ee4ff8 to 3a227cf Compare October 29, 2026 19:58
@trissim trissim changed the title Avoid eager thread and message acquisition for relationship displays Acquire display identities and relationship inputs through their declared owners Oct 29, 2026
@trissim
trissim force-pushed the work/frame-baseline--P954 branch from 4e99b1e to d0da7a9 Compare October 29, 2026 23:43
trissim added a commit that referenced this pull request Oct 30, 2026
Pin refactor-audit 705ebb65 (audit #10 carrying #9).

- tools/stored_formats.py: StoredForm deleted. It restated the audit's
  StoredFormat (three fields) to carry its own wire form, and treated only
  the top-level required as a set, so #3607's nested RegistryDocument
  required list reordering read as a format change. stored_format(record)
  builds StoredFormat.declared, and the audit owns sets at every depth and
  wire(). claude-code 8bfa094055fd, 580764ff8059, d98616a29150.
- tools/agent_comms_project.py: the probe output decodes through
  StoredFormat.declared(**form), with no subscripts. PinnedAudit.has and its
  bare subprocess git are deleted for Repository.has.
- ClientTypeErrors.findings runs mypy each comparison. The client commit read
  and the src identity, which existed only for the memo key, are gone. Mypy
  reads PEP 561 packages on PYTHONPATH that no content key names. Codex
  1a5fa2bdbb7a, 073483f8114b; carrier 3d3a357.
- tests: test_type_counts_follow_the_installed_dependency_not_a_stored_count
  is carried from 3d3a357 onto the TypeErrors/ClientTypeErrors CheckerSite
  API, for source and client. The 12-case
  test_declared_decoder_boundary_is_shared_by_both_contextual_absence_measures
  (imported, aliased, qualified, module, relative, undecorated,
  different-owner, duplicate, conditional, star, class-shadowed,
  parameter-shadowed) is carried for NoneAbsence and ForeignAbsenceProbe
  through AgentCommsProject.absence_boundaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dS2Kmg1WxNnAc78YHA
@trissim
trissim force-pushed the work/frame-baseline--P954 branch from d0da7a9 to 544dc19 Compare October 30, 2026 00:54
trissim and others added 6 commits October 29, 2026 23:08
…P954

# Conflicts:
#	src/agent_comms/registry_document.py
#	tests/test_sidebar_observation.py
Two definitions in one class: the later uncached copy overrode the cached
immutable map at line 432 and called incarnation as a method. One owner
remains; the unused ThreadIncarnationRecord import goes with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RnH6dR85kyFKcc2tQAJLhK
…P954

# Conflicts:
#	src/agent_comms/registry_document.py
#	tests/test_bus.py
…P954

# Conflicts:
#	src/agent_comms/field_codec.py
@trissim
trissim disabled auto-merge October 30, 2026 17:23
…P954

# Conflicts:
#	src/agent_comms/bus.py
#	src/agent_comms/historical_views.py
#	src/agent_comms/locked_store.py
#	src/agent_comms/store_files.py
@trissim
trissim enabled auto-merge October 30, 2026 19:48
…aps it as checked_page

The gate charged NoneAbsence at historical_views.py:597 as introduced: the
traversal body, unchanged from main, moved into a new _integrated_page scope
and integrated_page became the revision-checking wrapper. The traversal keeps
its name and scope; the wrapper is the new member, checked_page, and
HistoryView.reading binds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbFMSoWgC3ZwKzjT4SwMDu
…ns again

test_normal_comms_api_contains_history_and_execution_stays_live came in from
main still calling collect(live, "history_page", target), the helper's old
shape; this branch had changed collect to take a HistoryView, so it raised
TypeError at test_historical_views.py:358. collect now takes the page reader
itself, and each caller passes the one it reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbFMSoWgC3ZwKzjT4SwMDu

trissim commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Closed in Tristan's board clear (2026-11-02): P954, no activity since Oct 30 (its Toad pair, Toad#1361, closes with it). The branch is kept, so the work stays recoverable. Re-land any part still needed as a fresh PR on current main.


Generated by Claude Code

@trissim trissim closed this Nov 2, 2026
auto-merge was automatically disabled November 2, 2026 18:11

Pull request was closed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants