Skip to content

Finish the v0.1 release gates and architecture follow-ups #1

Open

Description

@abhishekgahlot2

v0.1 feature work is on main at 15925ee34f9c64d76e5c0c4cfe7e80c3166b740e. This tracks the remaining architecture and release-gate follow-ups against that exact commit. The review samples implementation paths in TypeScript and Python; it does not claim a fresh full-suite release certification.

Independent assessment

REQUEST CHANGES — architecture BLOCK — 2 confirmed HIGH findings.

Assessment Rating /10
Design foundations 8.2
Current enforced architecture 6.4
Current implementation 6.5
Public API 7.4

The event-log, transactional projection and conservative recovery design is strong. Two provider-authority failures prevent release approval at the reviewed commit:

  1. A2A outbound requests omit the actual lease fence in both runtimes. TypeScript drops ToolContext.fence when constructing Sending; Python substitutes an always-success fence when its sender omits authority. The earlier core check cannot cover ownership loss during DNS/connect. Require run authority at the actual transport write across send/status/follow/reconcile/member paths.
  2. Python Writer fence/renew ignore commit-unknown poison and evaluate time before queued store execution. Fault probes confirm successful ownership answers after uncertainty or expiry. Reject poisoned authority and evaluate time within the actual serialized store check.

Exact source paths and correction scope. Runnable reproducer and observed output. The saved probe was independently rerun, exit 0, with identical results. TypeScript A2A was source-traced; no separate TS runtime fault probe or live provider call was performed.

Closure requires repair SHAs and the focused stale-after-connect, commit-unknown and queued-expiry regression evidence. Do not replace these proofs with a whole-suite pass or a readability score.

Confirmed gate follow-ups

  • Close or explicitly correct the 14 entries in spec/api-surface-gaps.json. Five are marked missing and nine placement. Normal CI allows the registered gaps; check_surface.py rejects them only with --release. Invoke that gate for the release candidate after the registry is reconciled.
  • Repair the scheduled UI drift alarm's setup. Run 36427776409 exits at generation with uv: command not found; the actual drift checks never execute. ui-drift.yml runs the both-language generator without installing uv. Generate TS-only if no Python host is required, or install and sync the Python environment. This is a broken non-gating alarm, not evidence of a UI protocol regression.
  • Extend the existing source/API checks where their coverage is insufficient. check_api.py validates the contract, but generated TypeScript surface assertions and Python surface reflection already verify exports, option presence and required flags. Adapter factories have additional signature checks. Identify uncovered core signatures and undeclared root exports, then extend those existing checks instead of introducing a second API scanner.

Review ownership

Claude owns the three Python validation repairs reported in the readability audit: A2A tool validation mode, duplicated positive-integer predicates without the safe-integer ceiling, and remote timeout input types. The architecture review owns independent assessment and evidence; no duplicate implementation lane.

Assess writer/store/team modules by responsibility and invariant ownership, rather than replace the 400-line file cap with another class-size cap. Preserve cohesive facades and keep admission, ownership and durable side-effect invariants together.

Both independent assessments are complete. Additional non-blocking concerns are Python core's concrete A2A RemoteTool dependency (prefer the existing core-owned tool-runner abstraction) and recovery documentation that distinguishes log-derived execution state from durable host receipts/inbox/schedule rows. Ratings are bounded engineering judgements, not benchmarks or proof that every feature was reviewed. TypeScript, Python, Postgres, Docker and docs CI passed at the reviewed commit; that is inherited CI evidence, not a fresh blanket rerun.

Activity

  1. abhishekgahlot2 commented on Sep 29, 2026

    @abhishekgahlot2
    ContributorAuthor

    Two confirmed HIGH dispatch-authority defects at reviewed commit 15925ee34f9c64d76e5c0c4cfe7e80c3166b740e block a release-ready verdict. These have been sent to Claude for implementation ownership.

    1. A2A outbound requests lose the run's lease fence in both runtimes. TS sender construction drops ctx.fence; Sending/call cannot pass authority and calls the transport directly. Python sender construction leaves the fence absent; protocol.call substitutes an always-success callback at the real write boundary. A narrow Python sender/transport probe produced a2a None True: sending was admitted without writer authority. An earlier core fence does not cover lease loss while DNS or connection awaits. Thread required invocation authority through all remote-tool/member send, status and reconcile paths to the final provider write. Prove stale-after-connect sends no bytes in TS and Python.

    2. Python Writer fencing ignores poison and samples time before queued store execution. writer.py returns successful fence/renew results after commit-unknown poison; its lease check uses time captured before the store worker executes. Fault probes produced append=Err(writer_poisoned), fence=Ok, renew=Ok after synthetic post-COMMIT uncertainty, and queued-expiry=Ok after TTL followed by a fresh Err(stale_epoch). The model send tracer trusts this result. Coordinate with writer serialization, reject poison, and sample the clock inside the actual store callback immediately before check/renew. Prove both fault sequences.

    Scope: the probes confirm an invalid dispatch-admission decision and the actual paths trusting it. They do not claim a live provider repeated a paid operation or that every release path was re-tested. No paid calls or broad test suites were used.

  2. abhishekgahlot2 commented on Sep 29, 2026

    @abhishekgahlot2
    ContributorAuthor

    Runnable ownership reproducer for reviewed commit 15925ee34f9c64d76e5c0c4cfe7e80c3166b740e. This was executed by the implementation reviewer and independently rerun from the saved artifact, with identical output. It uses in-memory SQLite, local worker fault injection, and a fake transport; it sends no network request.

    In a checkout of that commit, sync the existing Python dev environment and run ./scripts/generate.sh py. Save the code below as /tmp/review_probes.py, then run:

    PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=python/src:python/tests/store python/.venv/bin/python /tmp/review_probes.py

    Observed:

    poison Err writer_poisoned Ok Ok
    queued-expiry Ok Err stale_epoch
    a2a None True
    

    The queued-expiry probe deliberately blocks the store worker and advances its test clock. The poison probe wraps a completed write with synthetic commit-unknown uncertainty. The A2A probe exercises the exact sender configuration with a transport that checks its supplied fence.

    """Targeted review probes for Threads commit 15925ee34f9c64d76e5c0c4cfe7e80c3166b740e."""
    
    import asyncio
    import threading
    
    from test_writer import Clock, DONE, TTL, started, user
    from threadsai.a2a.protocol import Wire, call
    from threadsai.a2a.remote import remote
    from threadsai.result import Err, Ok
    from threadsai.store import SqliteStore
    from threadsai.store.conn import CommitUnknownError
    from threadsai.web.http import WebError
    
    
    class UnknownAfterCommit:
        def __init__(self, inner: object) -> None:
            self.inner = inner
            self.fail = True
    
        async def call(self, statement: object) -> object:
            value = await self.inner.call(statement)
            if self.fail:
                self.fail = False
                raise CommitUnknownError("synthetic commit outcome unknown")
            return value
    
        async def read(self, statement: object) -> object:
            return await self.inner.read(statement)
    
        async def free(self, job: object) -> object:
            return await self.inner.free(job)
    
    
    class ProbeTransport:
        def __init__(self) -> None:
            self.fence_result: bool | None = None
    
        async def send(self, target: object, request: object, fence: object, max_bytes: int) -> object:
            self.fence_result = await fence()
            return Err(WebError("unavailable", "probe", False))
    
    
    async def public(_host: str, _port: int) -> tuple[str, ...]:
        return ("93.184.216.34",)
    
    
    async def poison_probe() -> None:
        opened = await SqliteStore.open(":memory:")
        assert isinstance(opened, Ok)
        store = opened.value
        clock = Clock()
        try:
            writer = await started(store, clock)
            writer._worker = UnknownAfterCommit(writer._worker)
            try:
                await writer.append([user("maybe"), DONE])
            except CommitUnknownError:
                pass
            append_again = await writer.append([user("again")])
            fenced = await writer.fence()
            renewed = await writer.renew()
            print(
                "poison",
                type(append_again).__name__,
                getattr(getattr(append_again, "error", None), "code", None),
                type(fenced).__name__,
                type(renewed).__name__,
            )
        finally:
            await store.close()
    
    
    async def queued_expiry_probe() -> None:
        opened = await SqliteStore.open(":memory:")
        assert isinstance(opened, Ok)
        store = opened.value
        clock = Clock()
        try:
            writer = await started(store, clock)
            entered = threading.Event()
            release = threading.Event()
    
            def block(_conn: object) -> None:
                entered.set()
                release.wait(timeout=2)
    
            blocking = asyncio.create_task(writer._worker.free(block))
            while not entered.is_set():
                await asyncio.sleep(0)
            fenced_task = asyncio.create_task(writer.fence())
            await asyncio.sleep(0.02)
            clock.now += TTL + 1
            release.set()
            await blocking
            fenced = await fenced_task
            fresh = await writer.fence()
            print(
                "queued-expiry",
                type(fenced).__name__,
                type(fresh).__name__,
                getattr(getattr(fresh, "error", None), "code", None),
            )
        finally:
            await store.close()
    
    
    async def a2a_probe() -> None:
        transport = ProbeTransport()
        partner = remote(
            "partner",
            "https://partner.example/card",
            transport=transport,
            resolve=public,
        )
        tool = partner.tools(name="partner", description="send")[0]
        sending = tool._sending()
        await call(Wire("https://partner.example/a2a", "JSONRPC"), "SendMessage", {}, sending)
        print("a2a", sending.fence, transport.fence_result)
    
    
    async def main() -> None:
        await poison_probe()
        await queued_expiry_probe()
        await a2a_probe()
    
    
    asyncio.run(main())
  3. abhishekgahlot2 commented on Sep 29, 2026

    @abhishekgahlot2
    ContributorAuthor

    Both HIGH findings from the 2026-09-30 architecture review are closed and merged to main.

    Finding Commit On main
    HIGH 1 — A2A outbound lost the run's fencing authority 6049f1927c276c75b873cb7d223b3dbf0c9bc1c6 yes
    HIGH 2 — Python writer fencing ignored poison and used a queue-time clock 4e3da7a0beed156f44a9106030bcd139c1bd098f yes

    Main is fb3092c6. CI at 4e3da7a0: python 36625952451 success, typescript 36625952415 success, postgres 36625952474 success. docker and docs were not triggered by these paths and are not claimed green.

    HIGH 1 — what changed. Sending.fence is now a required field in both languages and _always_fenced is deleted, so an absent fence is a type error rather than an assumption; pyright found the one remaining unfenced construction site the moment the field became required. The invocation's own fence now flows through send, status, reconcile, begin and the card read. Member remotes ride the same RemoteTool path, so one change covers them.

    HIGH 1 proof. python/tests/a2a/test_outbound_fence.py and typescript/packages/a2a/test/outbound/fence.test.ts hand the branch to another owner after the socket is up and before the fence is awaited — the point web/http.py:72 checks — by advancing the clock past the TTL and re-acquiring at a new epoch. Each asserts zero bytes written (sends() == []), that remote_call stayed durable, and a branch_busy halt. Verified by reverting: at the reviewed behaviour the first Python test fails assert ['card', 'SendMessage'] == ['card'] — the send left after the branch changed owner. Reinstating only the success-default reproduces two failures.

    HIGH 2 proof. tests/store/test_writer_fencing.py pins both sequences: a poisoned writer now refuses fence and renew as append already did, and the clock is sampled inside the store callback immediately before lease.check/lease.renew rather than before queueing. The postgres run executed it on both engines with no skips.

    On the gate question — taking your answer: keeping the existing surface checks, extending core signature assertions, reconciling the registry rows and exercising --release, classifying dependency direction explicitly, and reviewing unit cohesion by responsibility rather than by length. No class-length quota, and the writer transaction stays intact.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions