You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
service-knowledge: a build that loses its lease stops at the next page, and a build has a time bound #37465
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p2Medium: important, M3
Filing gate: ② follow-up out of #37099 (PR #37439, contract record 7184443506 finding S1, seat L1 7184456563), filed by the owning zone ai-37000 under topic #37000, per the maintainer's standing permission for areas to file their own follow-up cards.
Grading: area:ai · Bug · p2 (suggested; triage seat offline) · reach: deployments with more than one server node, and any build whose embedding call hangs · evidence: read from the PR #37439 code by the contract reviewer, not run.
When the build lease lapses mid-build (lock store unreachable past the renewal window, or a renewal that hangs), the walk only logs a warning and keeps going. It does not check isHeld() between pages and does not pass the fencing token down, so a second node's boot pass can build the same source. The index is not corrupted (same ids and hashes; generation stores take their own builder lock in beginBuild), but the embedding spend doubles.
A build whose embedding call never returns keeps renewing its lease forever. Only a restart cancels it, and the same node refuses a second rebuild meanwhile.
Acceptance
The walk checks the lease before each page and stops, recording a lease-lost result, once it is no longer held. A test drives a lapsed lease mid-walk and asserts no further page is embedded.
A build has a bound (a setting or a fixed ceiling, with its reader in the same PR per ADR-0049); past it the build is cancelled, the lease released, and the result recorded. A test drives a never-resolving embed call.
Docs in content/docs/ai/knowledge-rag.mdx state both behaviours.
Triage: lands in area:ai · domain:server · Bug · priority:p2 · pm:queue · size S; rationale: on multi-node deployments a build that loses its lease keeps going, so two nodes can embed the same source and double the cost, and a hung embedding call holds the lease until restart. Read from the code, not run: p2 as suggested.
Also carried from #37101 (PR #37492, os-dev report 7188339132): the pgvector store's builder lock is a PostgreSQL session advisory lock, released after buildLockIdleMs (15 min) idle or when its session drops. A build that loses it is not fenced mid-walk either. A second builder writes the same generation under the same fingerprint, so the index stays correct and only the embedding spend doubles. The stop-at-next-page check in this card's acceptance covers both the cluster lease and this advisory lock.
Scope note · 2026-11-26T09:56Z · zone ai-37000 (seat L1 7188645663 on PR #37492, finding N1)
Adapter-side acceptance line for this card: completeBuild completes only the generation that this builder opened. A builder that lost its lock, while another builder has since taken the source up, cannot switch or delete that builder's generation. The refusal is coded, and a test drives two builders where the first one's lock lapses.
These pgvector generation edge cases are carried here because they sit on the same build path:
N3: a search that meets three generation switches in a row throws an Error with no code. The fix is to give it CONCURRENT_MODIFICATION (409) and remove that code's row from scripts/error-status-unpinned-baseline.json in the same PR.
N2: after the fingerprint is reverted to the active one, the building generation is left in place, holding rows that are never read. It is retired at the next build under another fingerprint. Retire it at beginBuild instead.
N4: two sweeps of the same retired generation can leave passage rows behind. They are never read, and orphan cleanup removes them when the source next opens a generation. Optional.
First touch · 2026-11-26T12:36Z · zone ai-37000, on the maintainer's word (the triage seat is offline)
Grade confirmed as filed: Bug · area:ai · domain:server · p2. Routed to zone ai-37000 (topic #37000) and put in pm:queue.
Whose order: the maintainer (Bill). Verbatim: 「按建议定级,可以开」. Where: the seat-5 project thread for zone ai-37000, 2026-11-26T12:36Z, answering the zone's proposal of grades and order for #37465, #37466, #37467 and #37545.
Claim: PM loop round 1 · zone ai-37000 (topic #37000) · 2026-11-26T12:38Z
Session: session_01Utp6Cb4BAjgQ43tqy1DvVJ
Account: os-bill
Area: ai-37000
Branch: claude/issue-37465-build-lease-fence
Worktree: objectstack-issue-37465
Domain: domain:server
Seat: repo:objectstack#5
File surface: packages/services/service-knowledge/src/knowledge-build.ts, knowledge-build-actions.ts and new test files in packages/services/service-knowledge/src/__tests__/; packages/plugins/knowledge-pgvector/src/ (fence on a lost advisory lock, completeBuild only for the generation this builder opened, N2/N3/N4) and new test files; packages/plugins/knowledge-turso/src/ only if its completeBuild needs the same own-generation check; scripts/error-status-unpinned-baseline.json (the CONCURRENT_MODIFICATION row, N3); content/docs/ai/knowledge-rag.mdx; .changeset/ (stop on breach; explain in the report)
Container & model: M, mode:subagent, model: default (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable), effort: high
Clause-②: no
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 7192233569
Premise: holds (filed from contract record 7184443506 S1 on PR #37439, merged; scope notes on this card from PR #37492, merged)
Pre-claim lane: domain:server — packages/services/service-knowledge and packages/plugins/knowledge-*
Pre-claim deps: none (#37099 and #37101 merged)
Prior rulings read: ADR-0161 (no new adapter-contract member unless admitted); ADR-0049 (a bound's key lands with its reader)
Serial constraints cleared: PR #37442 (#37102) and #37304 (card thread) both edit knowledge-service-plugin.ts, knowledge-service.ts and service-settings' knowledge manifest: this card stays out of those files (no new settings key; the build bound is a plugin option or a fixed ceiling); overlap-check before each push.
{
"issue": 37465,
"status": "blocked",
"branch": "claude/issue-37465-build-lease-fence",
"pr": null,
"session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ",
"premise_still_valid": true,
"summary": "Stopped before any edit, per the dispatch order's stop rule: the cluster-lease fence (Acceptance 1, cluster half) and the build bound (Acceptance 2) cannot be built without editing knowledge-service.ts, which the order puts out of bounds. Measured on origin/main 1af67b26c: the page loop is KnowledgeService.walkObjectSource (knowledge-service.ts line 499, loop at 608, upsert at 671) and the lease, the walk's await and the release all sit in KnowledgeService.rebuildSource (line 920; keepBuildLeaseAlive at 970 only logs 'The build continues'; await this.reindexWith at 992; release in its finally). The only knowledge-build.ts symbols on the build path are keepBuildLeaseAlive (synchronous, returns a stop function), BUILD_LEASE_MS, buildLockKey and emptyBuildProgress; none is inside the walk's await chain, so neither a per-page lease check nor a race of the walk against a bound can live in knowledge-build.ts or knowledge-build-actions.ts, and a pgvector-side check fences only pgvector's own advisory lock, never the cluster lease. The claim's file surface names knowledge-build.ts for work that lives in knowledge-service.ts. The card's premise holds (line 970-977: a failed renewal only logs). The branch was pushed empty (head = origin/main 1af67b26c) as the landing marker; no commit, no PR, worktree removed. Doable now without the blocked files: the whole pgvector half (fence on a lost advisory lock inside the store's build writes, completeBuild only for the generation this builder opened with a coded refusal and a two-builder test, N2, N3 with the baseline row, N4 optional) and the knowledge-turso measurement; the cluster-lease fence, the bound and the docs for both wait on the decision below.",
"tests": "none run: no diff. pnpm install --frozen-lockfile in the worktree finished (Done in 8.9s) before the stop.",
"gates": "none run: no diff; dispatch-gates --commands not derived (empty change set). No PR, so no check-runs.",
"dogfood_battery": "n/a: no PR, no diff",
"mcp_calls": "0",
"api_writes": "1: POST issues/37465/comments (this os-dev-report, via post-stamped.mjs). git push of the empty branch is not a REST write.",
"open_questions": [
{
"question": "How does the cluster-lease fence and build bound reach knowledge-service.ts, which this order excludes?",
"options": [
"A. Lift the exclusion for walkObjectSource and rebuildSource only (knowledge-service.ts lines 456-1035 at 1af67b26c) and re-dispatch the whole card. Measured: PR #37442's knowledge-service.ts hunks sit at about lines 190-217 (getAdapter, reportUnmountedAdapters), 1545-1569 (the search loop) and 2174-2210 (helpers), so no textual overlap; #37304 has no PR yet, its overlap is not measurable. Cost: one rebase lap if #37442 lands first; the change is about 40-80 lines (a still-held check before each page's read, a bound timer racing the walk, two new record outcomes).",
"B. Split: dispatch the pgvector half now as Part of #37465 (fence on a lost advisory lock, own-generation completeBuild, N2, N3, N4, turso measurement); file the cluster-lease fence, the bound and their docs as a card Blocked-by #37442 and #37304.",
"C. Hold the whole card until #37442 and #37304 land."
],
"recommendation": "A, because the measured hunks do not overlap the walk or rebuildSource, the card stays one PR with one docs pass, and the bound's cancellation and the lease fence share one mechanism in rebuildSource; B if the zone wants the serial constraint kept literally."
},
{
"question": "Does the lease-lost outcome widen the public record shape?",
"options": [
"A. Add 'lease-lost' and a bound outcome to KnowledgeBuildRecord.status (exported from service-knowledge; index_status answers it over the settings action door): a widening of an exported type, Clause line amended to yes (widening).",
"B. Keep status 'failed' and carry the cause in a new optional field (for example reason: 'lease-lost' | 'time-bound'): still an exported-shape addition, widening as well."
],
"recommendation": "A, because the card says 'recording a lease-lost result' and index_status consumers read status; either way the zone amends the Clause line."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: zone ai-37000 · the claim 7192283508 file surface names knowledge-build.ts and knowledge-build-actions.ts for the walk fence, but the walk and the lease use live in knowledge-service.ts (lines 499-763 and 920-1035 at 1af67b26c); noted, not filed",
"carrier: zone ai-37000 · PR #37442 also edits content/docs/ai/knowledge-rag.mdx (+27 -2, the new 'Turning it on' section and the libSQL store paragraph); this card's docs item touches the same file, a different section; noted, not filed"
]
}
Q2: option A. KnowledgeBuildRecord.status gains lease-lost and a bound outcome.
Clause-②: yes (widening): an exported record type gains values, and new exported options if any. The bump stays patch.
{
"issue": 37465,
"status": "done",
"branch": "claude/issue-37465-build-lease-fence",
"pr": "https://github.com/objectstack-ai/objectstack/pull/37570",
"session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ",
"premise_still_valid": true,
"summary": "Built the whole card under claim amend 7192393989; final head 50bac3562 (draft PR #37570). service-knowledge: rebuildSource runs its walk under a build fence (startBuildFence in knowledge-build.ts). walkObjectSource checks the fence before each page and before the purge and completion. A lease the lock reports lost, or one not renewed within BUILD_LEASE_MS (an unreachable lock store or a hung renewal), stops the build with status lease-lost and releases the lease. The bound is a fixed ceiling, not a settings key or option: BUILD_STALL_LIMIT_MS, 15 minutes without a page finishing. Past it the build is cancelled, the lease released, and the status is timed-out. The page-loop calls and the whole walk are raced against the bound, so the walk chain is freed. knowledge-pgvector: each build write or removal checks pg_locks on the lock's own session and is refused LOCK_CONFLICT 409 once the advisory lock is gone. completeBuild completes only the build this adapter began and only the generation that build began (coded LOCK_CONFLICT refusal otherwise). A kept lock is re-checked at beginBuild. N3: an exhausted search is CONCURRENT_MODIFICATION 409. N2 already held at beginBuild (measured live; pinned by a test, documented). N4 was not implemented, because two concurrent sweeps now need two lock holders, which the fence refuses. knowledge-turso was measured and not changed: it has no builder lock, so there is no builder identity beyond the fingerprint, which completeBuild already requires. Docs and changeset done. Edits to knowledge-service.ts stay in walkObjectSource and rebuildSource, plus the import block and a one-parameter fence pass-through in reindexWith. Widening: KnowledgeBuildRecord.status gains lease-lost and timed-out; nothing else newly exported from the package entry (the claim already reads Clause-②: yes (widening)).",
"tests": "At 9c8ea6d38/01488b87c, before the merge of main: service-knowledge full suite under the lock, 'Test Files 15 passed (15) / Tests 456 passed (456)', VERDICT command-exit 0. Typecheck exit 0 for both packages. knowledge-pgvector against a local PostgreSQL 16.16 with pgvector 0.8.7, OS_EXPECT_LIVE_DIALECT_MATRIX=1: 'Test Files 8 passed (8) / Tests 83 passed (83)' (baseline before this PR: 6 files, 76 tests; new: build-fence.live-postgres.test.ts with 6 cases, search-switches.test.ts with 1). At final head 50bac3562: pgvector live again 83/83, and fence plus build tests 30/30. Ablations (each a mutation on disk, then git restore; status porcelain 0 after): the per-page lease check disabled turned 2 fence cases red; pgvector fenceBuild disabled turned 2 live cases red; the rebuildSource race disabled turned the hung-completeBuild case red (the case was added after the first ablation of the race stayed green: the walk's own race had covered the page loop).",
"gates": "overlap-check at 01488b87c: 'VERDICT clean exit 0' against origin/main 4116465625 and #37442. dispatch-gates --commands at 50bac3562 (--repo objectstack-ai/objectstack): 109 derived; --ran reconciliation 'Run reconciliation — 109 derived, 107 run, 2 NOT-MEASURED, 0 UNRUN' exit 0. The two NOT-MEASURED both exited 3, PREREQUISITE NOT MET: check-plugin-teardown-shape --self-test (shallow clone) and spec check:skill-examples (client-react not built). spec check:docs exited 1 at first: the gitignored schema tree was stale after the merge of main. After 'pnpm --filter @objectstack/spec build' (VERDICT command-exit 0) it re-ran to exit 0, '252 generated files in sync'. Earlier round: check:objectql-double-limit flagged the new live test's engine double as unjudged; it was fixed (the double now filters and bounds) and re-ran to exit 0. check:error-status-conformance exit 0 after removing the CONCURRENT_MODIFICATION and LOCK_CONFLICT rows. PR #37570 check-runs at 50bac3562: 55 completed, 40 success, 15 skipped, 0 failure. Required contexts: Lint & Repo Gates success, TypeScript Type Check success, Test Core success (10/10 shards), Build Core success, Governed Surface Queue Guard success, Test UI success, Live E2E UI success, Dogfood Regression Gate success, Check Changeset success. Lint UI, Type Check UI and Build & E2E UI were skipped by their path selector. Temporal Conformance (live PG + MySQL) was skipped on the PR (it runs in the merge queue); its locally measured stand-in is the live pgvector count above.",
"dogfood_battery": "n/a: no ! in the PR title and the Clause arm is widening, not narrowing",
"mcp_calls": "0",
"api_writes": "4 relay writes this session as objectstack-fleet[bot], through post-stamped and fleet-write: POST issues/37465/comments (the first, blocked os-dev-report 7192364339); POST pulls (#37570, draft forced); POST issues/37570/assignees (os-bill, from the claim's Account); POST issues/37465/comments (this report). No labels were written.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none · noted in PR Acceptance notes, not filed · knowledge-turso search still throws an uncoded Error after three generation switches (turso-adapter.ts, 'changed 3 times during one search'), the sibling of N3; outside the claim's turso clause (completeBuild only) · dedupe words: turso search CONCURRENT_MODIFICATION switches",
"carrier: none · noted in PR Acceptance notes · N2 remainder: after a fingerprint revert, readIndexState reads current, so no build runs and the stale building generation stays until the next build of any kind; retiring it without a build needs indexStatus or a read-time sweep",
"carrier: zone ai-37000 · noted · deviations: (1) knowledge-service.ts edits beyond the two named functions are the import block and a one-parameter fence pass-through in reindexWith (needed to thread the fence into walkObjectSource), none in #37442's regions, overlap-check clean; (2) scripts/error-status-unpinned-baseline.json also lost its LOCK_CONFLICT row, which check:error-status-conformance demanded once the new pgvector refusals declared its status; (3) merged origin/main once before opening the PR (merge commit 50bac3562); (4) the local PostgreSQL ran under /var/tmp/os-issue-37465-pg, because the postgres user cannot traverse the scratchpad path; stopped and removed; (5) the commits carry the model-free trailer pair (AGENTS.md), not the harness reminder's model-named Co-Authored-By, and the PR footer is the session-URL form"
]
}
{
"issue": 37465,
"status": "done",
"branch": "claude/issue-37465-build-lease-fence",
"pr": "https://github.com/objectstack-ai/objectstack/pull/37570",
"session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ",
"premise_still_valid": true,
"summary": "Rework round for REWORK 7195089651 (record 7195078617); new head fda121f9a6edf2713f0a03d3a622b0819ee6fd05, no merge of main (overlap-check clean). S1: the private completeBuild helper in knowledge-service.ts checks fence.stop() first, so a lease lost during the purge, or a purge that answers after the bound, completes nothing; a new test loses the lease during the purge. S2: the document listing, purgeDocuments and adapter.completeBuild are now raced through fencedCall, so a hung store call frees the source's reindexTails chain. The hung-completeBuild test now starts a second build that reaches done, and a new test does the same for a hung listing and a hung purge. One limit stays (named in the PR notes): a hung purge removal still holds that one document's own recordSyncTails chain, which is per document and not the source's walk chain. S3: the pgvector builderLost remedy and the changeset name the transaction-mode pooler and say such a deployment's builds are now refused at the first page. N1: the CLI's KnowledgeBuildView.status and the rebuild.ts comments list lease-lost and timed-out, and the changeset gains @objectstack/cli patch. N4: the proposed PR body says turso's refusal is SERVICE_UNAVAILABLE 503 (coded), with the parity card left to the zone. N5: the docs' lease-lost sentence links back to item 5. N2 and N3 from the record are not changed (accepted as nits). The PR body was not patched; the full proposed body is in proposed_pr_body below.",
"tests": "At fda121f9a: knowledge-build-fence.test.ts 10/10 (new: lease lost during the purge; hung listing and hung purge, each timed-out with no completion and a second build done; the hung-completeBuild case extended to a second build done). service-knowledge full suite under the lock: 'Test Files 15 passed (15) / Tests 458 passed (458)', and typecheck in the same command, VERDICT command-exit 0. knowledge-pgvector live against a local PostgreSQL 16.16 with pgvector 0.8.7, OS_EXPECT_LIVE_DIALECT_MATRIX=1: 'Test Files 8 passed (8) / Tests 83 passed (83)'; typecheck exit 0. CLI: typecheck exit 0 (test-layer debt unchanged); src/commands/knowledge/knowledge.test.ts 7/7. Ablations (each a mutation on disk, then git restore; status porcelain 0 after), all red: the S1 fence check disabled turned the lease-lost-during-purge case red; fencedCall removed around completeBuild turned the hung-completeBuild case red (timeout: the second build waits behind the chain); removed around the purge, and separately around the listing, each turned the hung-listing/purge case red. Note: commit f9d6498ed briefly carried an unterminated string in the pgvector remedy; f9d6498ed..fda121f9a fixes it, and every reading above is at fda121f9a.",
"gates": "overlap-check at fda121f9a: 'VERDICT clean exit 0' against origin/main, #37442 and #37578 (shares rebuild.ts). dispatch-gates --commands at fda121f9a, --repo objectstack-ai/objectstack: 112 derived; --ran 'Run reconciliation — 112 derived, 109 run, 3 NOT-MEASURED, 0 UNRUN' exit 0. The 3 NOT-MEASURED all exited 3: check-plugin-teardown-shape --self-test (shallow clone), spec check:skill-examples (client-react not built), check:dual-build-cjs-loads (needs a full build). check:i18n, check:i18n-coverage and check:i18n-walk-parity (derived because the diff now touches packages/cli) exited 3 first because the CLI was not built; after their stated turbo prerequisite build they re-ran to exit 0 ('check-i18n-bundles: OK', 'check-i18n-coverage: OK', 'check-i18n-walk-parity: 17 declared group(s)'). PR #37570 check-runs at fda121f9a: 40 success, 15 skipped, 0 failure. Required contexts: Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate and Check Changeset all success. Lint UI, Type Check UI and Build & E2E UI skipped by path; Temporal Conformance (live PG + MySQL) skipped on the PR (merge queue only).",
"dogfood_battery": "n/a: no ! in the PR title and the Clause arm is widening, not narrowing",
"mcp_calls": "0",
"api_writes": "This round: 1 relay write, POST issues/37465/comments (this report). Earlier rounds: 4 (two report comments, POST pulls, POST issues/37570/assignees). The PR body was not patched (os-dev: the seat writes it); the proposed body is returned in proposed_pr_body.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: zone ai-37000 (parity card, per the seat's record) · knowledge-turso's three-switch search refusal is SERVICE_UNAVAILABLE 503 'store not ready' where pgvector now answers CONCURRENT_MODIFICATION 409 · not filed here",
"carrier: none · noted in PR Acceptance notes · a purge removal that never answers keeps that one document's per-document sync chain (recordSyncTails) held until it answers or the process restarts; the source's walk chain and other documents are free. Freeing it would mean changing chainAfter or purgeDocuments, helpers outside the claim",
"carrier: zone ai-37000 · noted · deviations this round: the private completeBuild helper and the listing/purge call sites in knowledge-service.ts are outside the amend's two named functions, as S1 and S2 order; packages/cli (knowledge-actions.ts type, rebuild.ts comments) is outside the original claim surface, as N1 orders; the changeset gains '@objectstack/cli': patch"
],
"proposed_pr_body": "returned in the final report only: it opens with the attribution comment line, which a GitHub comment must not carry"
}
{
"issue": 37465,
"status": "done",
"branch": "claude/issue-37465-build-lease-fence",
"pr": "https://github.com/objectstack-ai/objectstack/pull/37570",
"session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ",
"premise_still_valid": true,
"summary": "Rework round 3 for REWORK 7196485428 (delta record 7196464406, PASS); new head e5bac7e3ba7bd362eb932d7f5d8eef6a9678bf83, no merge of main (overlap-check clean against 54d6726c0). S4+S6, the seat's route: the completion is not a page. The private completeBuild helper keeps the S1 fence check, then calls the new fence.completing() (the stall bound disarmed for good; cancelled never settles after it) and awaits adapter.completeBuild with no fencedCall. The source's reindexTails chain therefore stays held until the completion settles: no build on this node begins (and takes pgvector's builder lock) beside an old switch or sweep, so the old call's finally can no longer clear a newer build's builds entry or lock. A switch that began before the bound commits and the record reads done or failed, never timed-out. Each purge deletion now ticks the fence (the serialize hook inside walkObjectSource), so a healthy large purge is never cut. S5: the per-document limit is kept and named as it is (PR note, docs, changeset, knowledge-build.ts header): a hung removal keeps its document listed and its queue held, so every later complete build waits there in its purge and is cancelled timed-out, until the removal answers or the process restarts; the listDocuments stub is gone and the test asserts that. The docs sentence 'a new rebuild can start without a restart' is corrected, and the docs say a switch that began before the bound still commits. One added test pins rebuildSource's whole-walk race, which became unpinned once the hung-completeBuild case was replaced. pgvector and the CLI are not touched this round.",
"tests": "At e5bac7e3b: knowledge-build-fence.test.ts 14/14. New or rewritten: (1) a completion answering only after 2x the bound: the record stays running with the lease kept (released 0); a rebuild asked meanwhile answers the same running record; a complete reindexSource asked meanwhile does not call beginBuild (count stays 1) until the completion settles; then done, released 1, and the queued walk's beginBuild runs second (count 2), so nothing of the old call can clear the newer build's entry or lock; (2) a purge of 3 deletions each taking bound-60s: done, purged 3; (3) a hung listing: timed-out, then done; (4) a hung purge removal with a store that keeps listing the document: build 1 timed-out; build 2 also timed-out at its purge, removals still 1, document still stored, completeBuild 0; after the removal answers the document is gone and build 3 is done; (5) a build queued behind a plain reindex whose upsert never answers: timed-out, released 1, beginBuild 0; (6) fence unit: after completing(), cancelled never settles and progressed() does not re-arm. service-knowledge full suite under the lock: 'Test Files 15 passed (15) / Tests 462 passed (462)', then typecheck, VERDICT command-exit 0. Ablations (each an on-disk mutation, then git restore --source=HEAD; status porcelain clean after), all red on the matching case: fence.completing() removed (completion case); the old fencedCall race around completeBuild restored (completion case); the purge-deletion tick removed (large-purge case); both unbounded guards in the fence removed (completing() unit case; removing only the arm() guard stayed green, because the timer callback guard also holds); the per-document chain around purge deletions removed (hung-purge-removal case); rebuildSource's Promise.race replaced by a plain await (queued-build case; before that case existed this ablation was green, which is why it was added). Process note: my first ablation pass restored files from the index before the edits were committed and wiped them; I reapplied the same edits, committed, and re-ran every ablation against the commit. Only the readings above count. pgvector: not touched this round, so no live rerun; its last live reading is 83/83 at fda121f9a.",
"gates": "overlap-check at e5bac7e3b: 'VERDICT clean exit 0' against origin/main 54d6726c0, #37442 and #37578. check-nul-bytes exit 0. dispatch-gates --commands at e5bac7e3b, --repo objectstack-ai/objectstack: 112 derived; --ran: 'dispatch-gates --ran: 112 derived famil(ies) accounted for — 111 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)', exit 0. NOT MEASURED: check-plugin-teardown-shape --self-test, exit 3 (shallow clone). The spec check:skill-examples and check:dual-build-cjs-loads gates both exit 0 this round, after the prerequisite builds. At the intermediate head 9e6639539, check:i18n-coverage exited 3 once (service-print build output missing while sibling gates built). After its stated prerequisite build it re-ran to 'check-i18n-coverage: OK (15 config(s), 577 baselined untranslated string(s), none new)', and in the final run at e5bac7e3b it exits 0 first time. PR #37570 check-runs at e5bac7e3b: 40 success, 15 skipped, 0 failure, none in progress. Required contexts all success: Lint & Repo Gates, TypeScript Type Check, Test Core (10/10 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate and Check Changeset. Temporal Conformance (live PG + MySQL) is skipped on the PR (merge queue only).",
"dogfood_battery": "n/a: no ! in the PR title and the Clause arm is widening, not narrowing",
"mcp_calls": "0",
"api_writes": "This round: 1 relay write, POST issues/37465/comments (this report). Earlier rounds: 5 (three report comments, POST pulls, POST issues/37570/assignees). The PR body was not patched; the full proposed body is in proposed_pr_body. It starts from the live body, keeps the seat's signed trailer line and the #37597 turso reference, and updates the stall-bound section, the files to read first, the two-minute check, Tests, Acceptance notes, Verification and the third quick-read line.",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: #37597 · turso parity (SERVICE_UNAVAILABLE 503 vs CONCURRENT_MODIFICATION 409), already filed by the zone · noted, not filed here",
"carrier: none · noted in PR Acceptance notes and docs · the per-document limit: a hung purge removal keeps its document listed and its sync queue held, so every later complete build is cancelled at its purge until the removal answers or the process restarts. Kept by the seat's ruling (freeing it would let a late delete race that document's event sync).",
"carrier: none · noted in PR Acceptance notes and docs · the price of the S4/S6 route: a completion that never answers keeps the build running, its lease renewed and the source's walk queue held until it answers or the process restarts",
"carrier: zone ai-37000 · correction to my round-2 report: it said freeing the per-document chain would need changes to chainAfter or purgeDocuments; the serialize lambda is built in walkObjectSource, as the delta record says. This round uses that seam only for the purge progress tick."
],
"proposed_pr_body": "returned in the final report only: it opens with the attribution comment line, which a GitHub comment must not carry"
}
PR #37570 merged as 9ed54cbc24 (head e5bac7e3b; contract record 7195078617, deltas 7196464406 + 7198334769 PASS, seat ACCEPT 7198343717; landing 7198368076). pm:dispatched removed.
Follow-ups: #37597 (turso search exhaustion → CONCURRENT_MODIFICATION 409, p3), #37644 (N6/N7: fence check before beginBuild and on each purge deletion, p3). Accepted limits named in the PR and docs: an unanswered completion keeps the build running; a hung purge removal holds that document's sync chain.
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p2Medium: important, M3
Activity
objectstack-fleet commentedon Nov 26, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in area:ai · domain:server · Bug · priority:p2 ·
pm:queue· size S; rationale: on multi-node deployments a build that loses its lease keeps going, so two nodes can embed the same source and double the cost, and a hung embedding call holds the lease until restart. Read from the code, not run: p2 as suggested.objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
Scope note · 2026-11-26T09:43Z · zone ai-37000
Also carried from #37101 (PR #37492, os-dev report 7188339132): the pgvector store's builder lock is a PostgreSQL session advisory lock, released after
buildLockIdleMs(15 min) idle or when its session drops. A build that loses it is not fenced mid-walk either. A second builder writes the same generation under the same fingerprint, so the index stays correct and only the embedding spend doubles. The stop-at-next-page check in this card's acceptance covers both the cluster lease and this advisory lock.objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
Scope note · 2026-11-26T09:56Z · zone ai-37000 (seat L1 7188645663 on PR #37492, finding N1)
Adapter-side acceptance line for this card:
completeBuildcompletes only the generation that this builder opened. A builder that lost its lock, while another builder has since taken the source up, cannot switch or delete that builder's generation. The refusal is coded, and a test drives two builders where the first one's lock lapses.objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
Scope note · 2026-11-26T11:19Z · zone ai-37000 (PR #37492 os-dev report 7190533996, seat L1 7188645663)
These pgvector generation edge cases are carried here because they sit on the same build path:
Errorwith no code. The fix is to give itCONCURRENT_MODIFICATION(409) and remove that code's row fromscripts/error-status-unpinned-baseline.jsonin the same PR.beginBuildinstead.objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
First touch · 2026-11-26T12:36Z · zone ai-37000, on the maintainer's word (the triage seat is offline)
Grade confirmed as filed: Bug · area:ai ·
domain:server· p2. Routed to zone ai-37000 (topic #37000) and put inpm:queue.Whose order: the maintainer (Bill). Verbatim: 「按建议定级,可以开」. Where: the seat-5 project thread for zone ai-37000, 2026-11-26T12:36Z, answering the zone's proposal of grades and order for #37465, #37466, #37467 and #37545.
objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
Claim: PM loop round 1 · zone ai-37000 (topic #37000) · 2026-11-26T12:38Z
Session:
session_01Utp6Cb4BAjgQ43tqy1DvVJAccount:
os-billArea: ai-37000
Branch:
claude/issue-37465-build-lease-fenceWorktree:
objectstack-issue-37465Domain:
domain:serverSeat:
repo:objectstack#5File surface:
packages/services/service-knowledge/src/knowledge-build.ts,knowledge-build-actions.tsand new test files inpackages/services/service-knowledge/src/__tests__/;packages/plugins/knowledge-pgvector/src/(fence on a lost advisory lock, completeBuild only for the generation this builder opened, N2/N3/N4) and new test files;packages/plugins/knowledge-turso/src/only if its completeBuild needs the same own-generation check;scripts/error-status-unpinned-baseline.json(the CONCURRENT_MODIFICATION row, N3);content/docs/ai/knowledge-rag.mdx;.changeset/(stop on breach; explain in the report)Container & model:
M,mode:subagent,model: default (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable),effort: highClause-②: no
Metadata-protocol: none
Responsibility:
n/a — not a defect cardThread-read: 7192233569
Premise: holds (filed from contract record 7184443506 S1 on PR #37439, merged; scope notes on this card from PR #37492, merged)
Pre-claim lane:
domain:server— packages/services/service-knowledge and packages/plugins/knowledge-*Pre-claim deps: none (#37099 and #37101 merged)
Prior rulings read: ADR-0161 (no new adapter-contract member unless admitted); ADR-0049 (a bound's key lands with its reader)
Serial constraints cleared:
PR #37442 (#37102) and #37304 (card thread) both edit knowledge-service-plugin.ts, knowledge-service.ts and service-settings' knowledge manifest: this card stays out of those files (no new settings key; the build bound is a plugin option or a fixed ceiling); overlap-check before each push.objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
os-dev-report
{ "issue": 37465, "status": "blocked", "branch": "claude/issue-37465-build-lease-fence", "pr": null, "session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ", "premise_still_valid": true, "summary": "Stopped before any edit, per the dispatch order's stop rule: the cluster-lease fence (Acceptance 1, cluster half) and the build bound (Acceptance 2) cannot be built without editing knowledge-service.ts, which the order puts out of bounds. Measured on origin/main 1af67b26c: the page loop is KnowledgeService.walkObjectSource (knowledge-service.ts line 499, loop at 608, upsert at 671) and the lease, the walk's await and the release all sit in KnowledgeService.rebuildSource (line 920; keepBuildLeaseAlive at 970 only logs 'The build continues'; await this.reindexWith at 992; release in its finally). The only knowledge-build.ts symbols on the build path are keepBuildLeaseAlive (synchronous, returns a stop function), BUILD_LEASE_MS, buildLockKey and emptyBuildProgress; none is inside the walk's await chain, so neither a per-page lease check nor a race of the walk against a bound can live in knowledge-build.ts or knowledge-build-actions.ts, and a pgvector-side check fences only pgvector's own advisory lock, never the cluster lease. The claim's file surface names knowledge-build.ts for work that lives in knowledge-service.ts. The card's premise holds (line 970-977: a failed renewal only logs). The branch was pushed empty (head = origin/main 1af67b26c) as the landing marker; no commit, no PR, worktree removed. Doable now without the blocked files: the whole pgvector half (fence on a lost advisory lock inside the store's build writes, completeBuild only for the generation this builder opened with a coded refusal and a two-builder test, N2, N3 with the baseline row, N4 optional) and the knowledge-turso measurement; the cluster-lease fence, the bound and the docs for both wait on the decision below.", "tests": "none run: no diff. pnpm install --frozen-lockfile in the worktree finished (Done in 8.9s) before the stop.", "gates": "none run: no diff; dispatch-gates --commands not derived (empty change set). No PR, so no check-runs.", "dogfood_battery": "n/a: no PR, no diff", "mcp_calls": "0", "api_writes": "1: POST issues/37465/comments (this os-dev-report, via post-stamped.mjs). git push of the empty branch is not a REST write.", "open_questions": [ { "question": "How does the cluster-lease fence and build bound reach knowledge-service.ts, which this order excludes?", "options": [ "A. Lift the exclusion for walkObjectSource and rebuildSource only (knowledge-service.ts lines 456-1035 at 1af67b26c) and re-dispatch the whole card. Measured: PR #37442's knowledge-service.ts hunks sit at about lines 190-217 (getAdapter, reportUnmountedAdapters), 1545-1569 (the search loop) and 2174-2210 (helpers), so no textual overlap; #37304 has no PR yet, its overlap is not measurable. Cost: one rebase lap if #37442 lands first; the change is about 40-80 lines (a still-held check before each page's read, a bound timer racing the walk, two new record outcomes).", "B. Split: dispatch the pgvector half now as Part of #37465 (fence on a lost advisory lock, own-generation completeBuild, N2, N3, N4, turso measurement); file the cluster-lease fence, the bound and their docs as a card Blocked-by #37442 and #37304.", "C. Hold the whole card until #37442 and #37304 land." ], "recommendation": "A, because the measured hunks do not overlap the walk or rebuildSource, the card stays one PR with one docs pass, and the bound's cancellation and the lease fence share one mechanism in rebuildSource; B if the zone wants the serial constraint kept literally." }, { "question": "Does the lease-lost outcome widen the public record shape?", "options": [ "A. Add 'lease-lost' and a bound outcome to KnowledgeBuildRecord.status (exported from service-knowledge; index_status answers it over the settings action door): a widening of an exported type, Clause line amended to yes (widening).", "B. Keep status 'failed' and carry the cause in a new optional field (for example reason: 'lease-lost' | 'time-bound'): still an exported-shape addition, widening as well." ], "recommendation": "A, because the card says 'recording a lease-lost result' and index_status consumers read status; either way the zone amends the Clause line." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: zone ai-37000 · the claim 7192283508 file surface names knowledge-build.ts and knowledge-build-actions.ts for the walk fence, but the walk and the lease use live in knowledge-service.ts (lines 499-763 and 920-1035 at 1af67b26c); noted, not filed", "carrier: zone ai-37000 · PR #37442 also edits content/docs/ai/knowledge-rag.mdx (+27 -2, the new 'Turning it on' section and the libSQL store paragraph); this card's docs item touches the same file, a different section; noted, not filed" ] }objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
Claim amend (claim 7192283508) · 2026-11-26T12:43Z
Answers to the os-dev report 7192364339:
packages/services/service-knowledge/src/knowledge-service.ts, limited towalkObjectSourceandrebuildSource(the page loop, the lease renewal, the walk's await and its release). PR feat(core): requires knowledge mounts the knowledge service and one vector store #37442's hunks in that file sit elsewhere (getAdapter / reportUnmountedAdapters, the search loop, helpers). Run overlap-check before each push. Whichever lands second merges main, and knowledge_source: admit the governed metadata type with its loader — registry, stack collection, ADR-0087 renames and retirements, the two authoring guards, one name per source #37304's card thread is told.KnowledgeBuildRecord.statusgainslease-lostand a bound outcome.Clause-②: yes (widening): an exported record type gains values, and new exported options if any. The bump stays patch.
objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
os-dev-report
{ "issue": 37465, "status": "done", "branch": "claude/issue-37465-build-lease-fence", "pr": "https://github.com/objectstack-ai/objectstack/pull/37570", "session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ", "premise_still_valid": true, "summary": "Built the whole card under claim amend 7192393989; final head 50bac3562 (draft PR #37570). service-knowledge: rebuildSource runs its walk under a build fence (startBuildFence in knowledge-build.ts). walkObjectSource checks the fence before each page and before the purge and completion. A lease the lock reports lost, or one not renewed within BUILD_LEASE_MS (an unreachable lock store or a hung renewal), stops the build with status lease-lost and releases the lease. The bound is a fixed ceiling, not a settings key or option: BUILD_STALL_LIMIT_MS, 15 minutes without a page finishing. Past it the build is cancelled, the lease released, and the status is timed-out. The page-loop calls and the whole walk are raced against the bound, so the walk chain is freed. knowledge-pgvector: each build write or removal checks pg_locks on the lock's own session and is refused LOCK_CONFLICT 409 once the advisory lock is gone. completeBuild completes only the build this adapter began and only the generation that build began (coded LOCK_CONFLICT refusal otherwise). A kept lock is re-checked at beginBuild. N3: an exhausted search is CONCURRENT_MODIFICATION 409. N2 already held at beginBuild (measured live; pinned by a test, documented). N4 was not implemented, because two concurrent sweeps now need two lock holders, which the fence refuses. knowledge-turso was measured and not changed: it has no builder lock, so there is no builder identity beyond the fingerprint, which completeBuild already requires. Docs and changeset done. Edits to knowledge-service.ts stay in walkObjectSource and rebuildSource, plus the import block and a one-parameter fence pass-through in reindexWith. Widening: KnowledgeBuildRecord.status gains lease-lost and timed-out; nothing else newly exported from the package entry (the claim already reads Clause-②: yes (widening)).", "tests": "At 9c8ea6d38/01488b87c, before the merge of main: service-knowledge full suite under the lock, 'Test Files 15 passed (15) / Tests 456 passed (456)', VERDICT command-exit 0. Typecheck exit 0 for both packages. knowledge-pgvector against a local PostgreSQL 16.16 with pgvector 0.8.7, OS_EXPECT_LIVE_DIALECT_MATRIX=1: 'Test Files 8 passed (8) / Tests 83 passed (83)' (baseline before this PR: 6 files, 76 tests; new: build-fence.live-postgres.test.ts with 6 cases, search-switches.test.ts with 1). At final head 50bac3562: pgvector live again 83/83, and fence plus build tests 30/30. Ablations (each a mutation on disk, then git restore; status porcelain 0 after): the per-page lease check disabled turned 2 fence cases red; pgvector fenceBuild disabled turned 2 live cases red; the rebuildSource race disabled turned the hung-completeBuild case red (the case was added after the first ablation of the race stayed green: the walk's own race had covered the page loop).", "gates": "overlap-check at 01488b87c: 'VERDICT clean exit 0' against origin/main 4116465625 and #37442. dispatch-gates --commands at 50bac3562 (--repo objectstack-ai/objectstack): 109 derived; --ran reconciliation 'Run reconciliation — 109 derived, 107 run, 2 NOT-MEASURED, 0 UNRUN' exit 0. The two NOT-MEASURED both exited 3, PREREQUISITE NOT MET: check-plugin-teardown-shape --self-test (shallow clone) and spec check:skill-examples (client-react not built). spec check:docs exited 1 at first: the gitignored schema tree was stale after the merge of main. After 'pnpm --filter @objectstack/spec build' (VERDICT command-exit 0) it re-ran to exit 0, '252 generated files in sync'. Earlier round: check:objectql-double-limit flagged the new live test's engine double as unjudged; it was fixed (the double now filters and bounds) and re-ran to exit 0. check:error-status-conformance exit 0 after removing the CONCURRENT_MODIFICATION and LOCK_CONFLICT rows. PR #37570 check-runs at 50bac3562: 55 completed, 40 success, 15 skipped, 0 failure. Required contexts: Lint & Repo Gates success, TypeScript Type Check success, Test Core success (10/10 shards), Build Core success, Governed Surface Queue Guard success, Test UI success, Live E2E UI success, Dogfood Regression Gate success, Check Changeset success. Lint UI, Type Check UI and Build & E2E UI were skipped by their path selector. Temporal Conformance (live PG + MySQL) was skipped on the PR (it runs in the merge queue); its locally measured stand-in is the live pgvector count above.", "dogfood_battery": "n/a: no ! in the PR title and the Clause arm is widening, not narrowing", "mcp_calls": "0", "api_writes": "4 relay writes this session as objectstack-fleet[bot], through post-stamped and fleet-write: POST issues/37465/comments (the first, blocked os-dev-report 7192364339); POST pulls (#37570, draft forced); POST issues/37570/assignees (os-bill, from the claim's Account); POST issues/37465/comments (this report). No labels were written.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted in PR Acceptance notes, not filed · knowledge-turso search still throws an uncoded Error after three generation switches (turso-adapter.ts, 'changed 3 times during one search'), the sibling of N3; outside the claim's turso clause (completeBuild only) · dedupe words: turso search CONCURRENT_MODIFICATION switches", "carrier: none · noted in PR Acceptance notes · N2 remainder: after a fingerprint revert, readIndexState reads current, so no build runs and the stale building generation stays until the next build of any kind; retiring it without a build needs indexStatus or a read-time sweep", "carrier: zone ai-37000 · noted · deviations: (1) knowledge-service.ts edits beyond the two named functions are the import block and a one-parameter fence pass-through in reindexWith (needed to thread the fence into walkObjectSource), none in #37442's regions, overlap-check clean; (2) scripts/error-status-unpinned-baseline.json also lost its LOCK_CONFLICT row, which check:error-status-conformance demanded once the new pgvector refusals declared its status; (3) merged origin/main once before opening the PR (merge commit 50bac3562); (4) the local PostgreSQL ran under /var/tmp/os-issue-37465-pg, because the postgres user cannot traverse the scratchpad path; stopped and removed; (5) the commits carry the model-free trailer pair (AGENTS.md), not the harness reminder's model-named Co-Authored-By, and the PR footer is the session-URL form" ] }objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
os-dev-report
{ "issue": 37465, "status": "done", "branch": "claude/issue-37465-build-lease-fence", "pr": "https://github.com/objectstack-ai/objectstack/pull/37570", "session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ", "premise_still_valid": true, "summary": "Rework round for REWORK 7195089651 (record 7195078617); new head fda121f9a6edf2713f0a03d3a622b0819ee6fd05, no merge of main (overlap-check clean). S1: the private completeBuild helper in knowledge-service.ts checks fence.stop() first, so a lease lost during the purge, or a purge that answers after the bound, completes nothing; a new test loses the lease during the purge. S2: the document listing, purgeDocuments and adapter.completeBuild are now raced through fencedCall, so a hung store call frees the source's reindexTails chain. The hung-completeBuild test now starts a second build that reaches done, and a new test does the same for a hung listing and a hung purge. One limit stays (named in the PR notes): a hung purge removal still holds that one document's own recordSyncTails chain, which is per document and not the source's walk chain. S3: the pgvector builderLost remedy and the changeset name the transaction-mode pooler and say such a deployment's builds are now refused at the first page. N1: the CLI's KnowledgeBuildView.status and the rebuild.ts comments list lease-lost and timed-out, and the changeset gains @objectstack/cli patch. N4: the proposed PR body says turso's refusal is SERVICE_UNAVAILABLE 503 (coded), with the parity card left to the zone. N5: the docs' lease-lost sentence links back to item 5. N2 and N3 from the record are not changed (accepted as nits). The PR body was not patched; the full proposed body is in proposed_pr_body below.", "tests": "At fda121f9a: knowledge-build-fence.test.ts 10/10 (new: lease lost during the purge; hung listing and hung purge, each timed-out with no completion and a second build done; the hung-completeBuild case extended to a second build done). service-knowledge full suite under the lock: 'Test Files 15 passed (15) / Tests 458 passed (458)', and typecheck in the same command, VERDICT command-exit 0. knowledge-pgvector live against a local PostgreSQL 16.16 with pgvector 0.8.7, OS_EXPECT_LIVE_DIALECT_MATRIX=1: 'Test Files 8 passed (8) / Tests 83 passed (83)'; typecheck exit 0. CLI: typecheck exit 0 (test-layer debt unchanged); src/commands/knowledge/knowledge.test.ts 7/7. Ablations (each a mutation on disk, then git restore; status porcelain 0 after), all red: the S1 fence check disabled turned the lease-lost-during-purge case red; fencedCall removed around completeBuild turned the hung-completeBuild case red (timeout: the second build waits behind the chain); removed around the purge, and separately around the listing, each turned the hung-listing/purge case red. Note: commit f9d6498ed briefly carried an unterminated string in the pgvector remedy; f9d6498ed..fda121f9a fixes it, and every reading above is at fda121f9a.", "gates": "overlap-check at fda121f9a: 'VERDICT clean exit 0' against origin/main, #37442 and #37578 (shares rebuild.ts). dispatch-gates --commands at fda121f9a, --repo objectstack-ai/objectstack: 112 derived; --ran 'Run reconciliation — 112 derived, 109 run, 3 NOT-MEASURED, 0 UNRUN' exit 0. The 3 NOT-MEASURED all exited 3: check-plugin-teardown-shape --self-test (shallow clone), spec check:skill-examples (client-react not built), check:dual-build-cjs-loads (needs a full build). check:i18n, check:i18n-coverage and check:i18n-walk-parity (derived because the diff now touches packages/cli) exited 3 first because the CLI was not built; after their stated turbo prerequisite build they re-ran to exit 0 ('check-i18n-bundles: OK', 'check-i18n-coverage: OK', 'check-i18n-walk-parity: 17 declared group(s)'). PR #37570 check-runs at fda121f9a: 40 success, 15 skipped, 0 failure. Required contexts: Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate and Check Changeset all success. Lint UI, Type Check UI and Build & E2E UI skipped by path; Temporal Conformance (live PG + MySQL) skipped on the PR (merge queue only).", "dogfood_battery": "n/a: no ! in the PR title and the Clause arm is widening, not narrowing", "mcp_calls": "0", "api_writes": "This round: 1 relay write, POST issues/37465/comments (this report). Earlier rounds: 4 (two report comments, POST pulls, POST issues/37570/assignees). The PR body was not patched (os-dev: the seat writes it); the proposed body is returned in proposed_pr_body.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: zone ai-37000 (parity card, per the seat's record) · knowledge-turso's three-switch search refusal is SERVICE_UNAVAILABLE 503 'store not ready' where pgvector now answers CONCURRENT_MODIFICATION 409 · not filed here", "carrier: none · noted in PR Acceptance notes · a purge removal that never answers keeps that one document's per-document sync chain (recordSyncTails) held until it answers or the process restarts; the source's walk chain and other documents are free. Freeing it would mean changing chainAfter or purgeDocuments, helpers outside the claim", "carrier: zone ai-37000 · noted · deviations this round: the private completeBuild helper and the listing/purge call sites in knowledge-service.ts are outside the amend's two named functions, as S1 and S2 order; packages/cli (knowledge-actions.ts type, rebuild.ts comments) is outside the original claim surface, as N1 orders; the changeset gains '@objectstack/cli': patch" ], "proposed_pr_body": "returned in the final report only: it opens with the attribution comment line, which a GitHub comment must not carry" }objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
Claim amend (claim 7192283508) · 2026-11-26T15:29Z
The surface follows seat REWORK 7195089651 (record 7195078617):
packages/services/service-knowledge/src/knowledge-service.tsadds the privatecompleteBuildhelper (fence re-check, S1), and the listing and purge call sites raced throughfencedCall(S2). PR feat(core): requires knowledge mounts the knowledge service and one vector store #37442's hunks are still untouched, and overlap-check is clean at fda121f.packages/cli/src/commands/knowledge/(theKnowledgeBuildView.statustype and therebuild.tscomments, N1). The changeset gains@objectstack/clipatch. This is serial with PR fix(cli): os knowledge rebuild and status give the right answer behind a load balancer #37578, which sharesrebuild.ts; overlap-check is clean.Clause-② is unchanged: yes (widening). The turso parity sibling is knowledge-turso: search exhaustion after generation switches answers CONCURRENT_MODIFICATION 409, like pgvector #37597.
objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
os-dev-report
{ "issue": 37465, "status": "done", "branch": "claude/issue-37465-build-lease-fence", "pr": "https://github.com/objectstack-ai/objectstack/pull/37570", "session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ", "premise_still_valid": true, "summary": "Rework round 3 for REWORK 7196485428 (delta record 7196464406, PASS); new head e5bac7e3ba7bd362eb932d7f5d8eef6a9678bf83, no merge of main (overlap-check clean against 54d6726c0). S4+S6, the seat's route: the completion is not a page. The private completeBuild helper keeps the S1 fence check, then calls the new fence.completing() (the stall bound disarmed for good; cancelled never settles after it) and awaits adapter.completeBuild with no fencedCall. The source's reindexTails chain therefore stays held until the completion settles: no build on this node begins (and takes pgvector's builder lock) beside an old switch or sweep, so the old call's finally can no longer clear a newer build's builds entry or lock. A switch that began before the bound commits and the record reads done or failed, never timed-out. Each purge deletion now ticks the fence (the serialize hook inside walkObjectSource), so a healthy large purge is never cut. S5: the per-document limit is kept and named as it is (PR note, docs, changeset, knowledge-build.ts header): a hung removal keeps its document listed and its queue held, so every later complete build waits there in its purge and is cancelled timed-out, until the removal answers or the process restarts; the listDocuments stub is gone and the test asserts that. The docs sentence 'a new rebuild can start without a restart' is corrected, and the docs say a switch that began before the bound still commits. One added test pins rebuildSource's whole-walk race, which became unpinned once the hung-completeBuild case was replaced. pgvector and the CLI are not touched this round.", "tests": "At e5bac7e3b: knowledge-build-fence.test.ts 14/14. New or rewritten: (1) a completion answering only after 2x the bound: the record stays running with the lease kept (released 0); a rebuild asked meanwhile answers the same running record; a complete reindexSource asked meanwhile does not call beginBuild (count stays 1) until the completion settles; then done, released 1, and the queued walk's beginBuild runs second (count 2), so nothing of the old call can clear the newer build's entry or lock; (2) a purge of 3 deletions each taking bound-60s: done, purged 3; (3) a hung listing: timed-out, then done; (4) a hung purge removal with a store that keeps listing the document: build 1 timed-out; build 2 also timed-out at its purge, removals still 1, document still stored, completeBuild 0; after the removal answers the document is gone and build 3 is done; (5) a build queued behind a plain reindex whose upsert never answers: timed-out, released 1, beginBuild 0; (6) fence unit: after completing(), cancelled never settles and progressed() does not re-arm. service-knowledge full suite under the lock: 'Test Files 15 passed (15) / Tests 462 passed (462)', then typecheck, VERDICT command-exit 0. Ablations (each an on-disk mutation, then git restore --source=HEAD; status porcelain clean after), all red on the matching case: fence.completing() removed (completion case); the old fencedCall race around completeBuild restored (completion case); the purge-deletion tick removed (large-purge case); both unbounded guards in the fence removed (completing() unit case; removing only the arm() guard stayed green, because the timer callback guard also holds); the per-document chain around purge deletions removed (hung-purge-removal case); rebuildSource's Promise.race replaced by a plain await (queued-build case; before that case existed this ablation was green, which is why it was added). Process note: my first ablation pass restored files from the index before the edits were committed and wiped them; I reapplied the same edits, committed, and re-ran every ablation against the commit. Only the readings above count. pgvector: not touched this round, so no live rerun; its last live reading is 83/83 at fda121f9a.", "gates": "overlap-check at e5bac7e3b: 'VERDICT clean exit 0' against origin/main 54d6726c0, #37442 and #37578. check-nul-bytes exit 0. dispatch-gates --commands at e5bac7e3b, --repo objectstack-ai/objectstack: 112 derived; --ran: 'dispatch-gates --ran: 112 derived famil(ies) accounted for — 111 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)', exit 0. NOT MEASURED: check-plugin-teardown-shape --self-test, exit 3 (shallow clone). The spec check:skill-examples and check:dual-build-cjs-loads gates both exit 0 this round, after the prerequisite builds. At the intermediate head 9e6639539, check:i18n-coverage exited 3 once (service-print build output missing while sibling gates built). After its stated prerequisite build it re-ran to 'check-i18n-coverage: OK (15 config(s), 577 baselined untranslated string(s), none new)', and in the final run at e5bac7e3b it exits 0 first time. PR #37570 check-runs at e5bac7e3b: 40 success, 15 skipped, 0 failure, none in progress. Required contexts all success: Lint & Repo Gates, TypeScript Type Check, Test Core (10/10 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate and Check Changeset. Temporal Conformance (live PG + MySQL) is skipped on the PR (merge queue only).", "dogfood_battery": "n/a: no ! in the PR title and the Clause arm is widening, not narrowing", "mcp_calls": "0", "api_writes": "This round: 1 relay write, POST issues/37465/comments (this report). Earlier rounds: 5 (three report comments, POST pulls, POST issues/37570/assignees). The PR body was not patched; the full proposed body is in proposed_pr_body. It starts from the live body, keeps the seat's signed trailer line and the #37597 turso reference, and updates the stall-bound section, the files to read first, the two-minute check, Tests, Acceptance notes, Verification and the third quick-read line.", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier: #37597 · turso parity (SERVICE_UNAVAILABLE 503 vs CONCURRENT_MODIFICATION 409), already filed by the zone · noted, not filed here", "carrier: none · noted in PR Acceptance notes and docs · the per-document limit: a hung purge removal keeps its document listed and its sync queue held, so every later complete build is cancelled at its purge until the removal answers or the process restarts. Kept by the seat's ruling (freeing it would let a late delete race that document's event sync).", "carrier: none · noted in PR Acceptance notes and docs · the price of the S4/S6 route: a completion that never answers keeps the build running, its lease renewed and the source's walk queue held until it answers or the process restarts", "carrier: zone ai-37000 · correction to my round-2 report: it said freeing the per-document chain would need changes to chainAfter or purgeDocuments; the serialize lambda is built in walkObjectSource, as the delta record says. This round uses that seam only for the purge progress tick." ], "proposed_pr_body": "returned in the final report only: it opens with the attribution comment line, which a GitHub comment must not carry" }Generated by Claude Code
objectstack-fleet commentedon Nov 26, 2026
repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
Delivered · 2026-11-26T17:49Z · zone ai-37000
PR #37570 merged as
9ed54cbc24(heade5bac7e3b; contract record 7195078617, deltas 7196464406 + 7198334769 PASS, seat ACCEPT 7198343717; landing 7198368076).pm:dispatchedremoved.Follow-ups: #37597 (turso search exhaustion →
CONCURRENT_MODIFICATION409, p3), #37644 (N6/N7: fence check beforebeginBuildand on each purge deletion, p3). Accepted limits named in the PR and docs: an unanswered completion keeps the build running; a hung purge removal holds that document's sync chain.