Skip to content

service-knowledge: os knowledge rebuild and status give the right answer behind a load balancer #37466

In progress

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ

Filing gate: ② follow-up out of #37099 (PR #37439, contract record 7184443506 finding S2, 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 · p3 (suggested; triage seat offline) · reach: operators running os knowledge against a multi-node deployment · evidence: read from the PR #37439 code by the contract reviewer, not run.

维护者速读

  • 做什么:多节点部署时,运维用命令行重建知识源或查看状态,要拿到正确结果,而不是看运气打到哪个节点。
  • 谁受益:多节点部署的运维和自动化脚本。
  • 不做会怎样:重建其实在跑、最后也成功了,命令行却可能报失败,脚本会当成故障处理。
  • 需要你做的:无。

What

As of PR #37439 (#37099), the build record (progress and last result, which card #37099 item 3 asks the operator entry to read) lives in memory on the node that ran the build and is gone on restart. Behind a load balancer, os knowledge status reaches the building node only by chance, and os knowledge rebuild exits 1 as soon as a poll lands on another node, although the build continues and may succeed.

Acceptance

One of, chosen in the PR with its reason:

  • the build record is shared across nodes (cluster or store backed), or
  • the CLI falls back to the index state read from the store, which is the same on every node (due turning current means done), and only reports failure on a recorded failure.

A test drives a poll that lands on a node without the record and asserts the command does not exit 1 while the build is still running or after it succeeded.

Activity

  1. added
    area:ai
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:server · Bug · priority:p3 · pm:queue · size S; rationale: behind a load balancer os knowledge rebuild / status can report failure for a rebuild that is running and succeeds. The CLI's answer is wrong but the work is done, and it affects multi-node operators only: p3 as suggested.

  3. added
    domain:server
    pm:queue
    on Nov 26, 2026
  4. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ

    First touch · 2026-11-26T12:37Z · zone ai-37000, on the maintainer's word (the triage seat is offline)

    Grade confirmed as filed: Bug · area:ai · domain:server · p3. 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.

  5. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ

    Claim: PM loop round 1 · zone ai-37000 (topic #37000) · 2026-11-26T13:31Z
    Session: session_01Utp6Cb4BAjgQ43tqy1DvVJ
    Account: os-bill
    Area: ai-37000
    Branch: claude/issue-37466-knowledge-cli-lb
    Worktree: objectstack-issue-37466
    Domain: domain:server
    Seat: repo:objectstack#5
    File surface: packages/cli/src/commands/knowledge/ (rebuild, status and their tests), packages/cli/src/utils/knowledge-actions.ts, content/docs/deployment/cli.mdx (the Knowledge section), .changeset/ (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: packages/cli knowledge commands (this repo) read a per-node in-memory build record | the index state read from the store is the same on every node | operators scripting os knowledge rebuild against a multi-node deployment
    Thread-read: 7192245194
    Premise: holds (filed from contract record 7184443506 S2 on PR #37439, merged)
    Pre-claim lane: domain:server — packages/cli
    Pre-claim deps: none
    Prior rulings read: none on this path beyond #37099's acceptance item 3
    Serial constraints cleared: Design is the card's second option: the CLI falls back to the index state, so no service-knowledge edit (#37465 and #37304 both edit knowledge-service.ts and build records). overlap-check before each push.

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 26, 2026
  7. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
    os-dev-report

    {
      "issue": 37466,
      "status": "done",
      "branch": "claude/issue-37466-knowledge-cli-lb",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37578",
      "session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ (subagent: parent's id)",
      "premise_still_valid": true,
      "summary": "Card's second option, no service change. Measured first: index_status already returns index (store state) and build (answering node's record or null) as separate fields, so 'no record on this node' and 'never built' are distinguishable. os knowledge rebuild now reads index_status once before starting (baseline); a poll answered by a node without this build's record (null, or another startedAt) no longer exits 1: when the baseline was not current, the index turning current means done (exit 0, counts not shown); when it was already current the index cannot show completion (same-fingerprint rebuild opens no building generation in knowledge-memory or knowledge-pgvector), so it polls until a read reaches the building node. Failure only on the build's recorded failed/not-run or the new --timeout (default 600s, polls times --interval, reset on each read of the record), whose message says the build may still be running. os knowledge status labels the record as the answering node's and says when that node holds none. Docs Knowledge section and patch changeset updated. Final head 91e9a5755.",
      "tests": "head 91e9a5755: lock VERDICT command-exit 0 for `pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 src/commands/knowledge/knowledge.test.ts` -> Test Files 1 passed, Tests 12 passed (6 new in describe 'a poll that lands on a node without the build record': still running, succeeded, older record, already-current waits and reports recorded failure, --timeout exit 1, timeout restart). Ablation: rebuild.ts restored to base c385d3bd1 with new tests -> Tests 9 failed | 3 passed; restored via git restore --source=HEAD, porcelain clean. `pnpm --filter @objectstack/cli typecheck` VERDICT command-exit 0 (check:test-typecheck OK). Dependency closure built with `pnpm --filter '@objectstack/cli^...' build` VERDICT command-exit 0.",
      "gates": "Local subset at 91e9a5755 (25 of 98 derived, declared narrowing; exit captured before any pipe), all exit 0: check-adr-0087-registration, check-changeset-no-major, check-closing-keyword-parity, check-doc-route-spelling --advisory, check-docs-section-name, check-empty-changeset, check-issue-citations, docs-audit/check-affected-docs, docs-audit/check-drift-comment, check:cli-command-ids, check:cli-examples-parity, check:closed-ceremony-text, check:cross-package-test-inputs, check:doc-anchors, check:doc-authoring, check:doc-frontmatter, check:docs-single-h1, check:docs-transcript-drift, check:docs-spec-enumerations, check:issue-citations, check:nul-bytes, check:role-word, check:test-source-alias, check:watch-hint-literal, check:undeclared-dep-imports. --ran reconciliation: '73 of 98 derived famil(ies) UNRUN' (left to CI). overlap-check VERDICT clean exit 0 (origin/main, #37513, #37422 merge cleanly). PR check-runs on 91e9a5755: 40 success, 15 skipped, 0 failure; required contexts success: Lint & Repo Gates, TypeScript Type Check, Test Core + shards 1-10/10, Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate; also Check Changeset success.",
      "dogfood_battery": "n/a: no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2: relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST issues/37578/assignees os-bill, one stroke, run 45833310559); post-stamped report comment on issues/37466. Plus git push (not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted in PR Acceptance notes, not filed: index_status carries no node identity, so status can only say 'the node that answered'",
        "carrier: none · noted in PR Acceptance notes, not filed: a failed build seen only via other nodes leaves the index due; the CLI cannot read that failure from the store and ends on --timeout"
      ]
    }
  8. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Cb4BAjgQ43tqy1DvVJ
    os-dev-report

    {
      "issue": 37466,
      "status": "done",
      "branch": "claude/issue-37466-knowledge-cli-lb",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37578",
      "session": "session_01Utp6Cb4BAjgQ43tqy1DvVJ (subagent: parent's id)",
      "premise_still_valid": true,
      "summary": "Rework of REWORK 7194818791 (record 7194806473), head 3b351697d. S1: changeset now Clause-② yes (widening), level stays patch; the PR body text with the same line is handed to the zone for the relay issue_patch (not written by the dev). S2: the index-current exit needs a baseline with due === true; unreadable, current, unread or never-current baselines wait for the building node's record. S3: the exit is skipped on the memory adapter (id 'memory', per-process index), and the docs and status line now say the index state is the same on every node only for a shared store. No merge of main was needed (merge-tree clean).",
      "tests": "head 3b351697d: knowledge.test.ts Tests 14 passed (2 new: unreadable baseline then current elsewhere is no exit 0; memory adapter current elsewhere is no exit 0, building node's done decides), lock VERDICT command-exit 0; cli typecheck VERDICT command-exit 0. Ablations on disk then restored: due predicate back to the state-based baseline -> 1 failed (unreadable case) 13 passed; memory check forced false -> 1 failed (memory case) 13 passed; porcelain clean after restore.",
      "gates": "Same 25-command local subset at 3b351697d, all exit 0; --ran: 73 of 98 UNRUN (left to CI). overlap-check VERDICT clean exit 0. PR check-runs on 3b351697d: 40 success, 15 skipped, 0 failure; required contexts success: Lint & Repo Gates, TypeScript Type Check, Test Core (+10 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate; Check Changeset success (it ran against the PR body that still says Clause-② no).",
      "dogfood_battery": "n/a: no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "this round 1: post-stamped report comment on issues/37466; git push x2 (not REST). PR body not written (zone patches it).",
      "open_questions": [],
      "security_findings": "withheld",
      "out_of_scope_findings": ["carrier: none · noted in proposed PR Acceptance notes: the memory check matches the default adapter id 'memory'; a memory adapter registered under another id is not recognised"]
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpm:dispatchedpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions