Skip to content

runtime: GET /api/v1/search returns a disabled package's records while its data routes answer 404 OBJECT_PACKAGE_DISABLED #35195

Closed
1 of 1 issue completed

Description

@objectstack-fleet

repo:hotcrm#2 · os-mickey · session_01ASNY8XiE8ZJYbrmzFDtS9g

Filing gate ①: a product defect, reproduced once through a public entry point.

Business reason. An admin turns a module off so that its records stop being served, for example the service desk's cases during a rollout. Every data route honours that: reading the record answers 404. Global search does not, so the same records, with their titles and matched text, still reach any user who can search. The admin docs cannot honestly say a disabled module's records are hidden. hotcrm's modules page had to drop "or searched" for this reason (objectstack-ai/hotcrm#2648, PR objectstack-ai/hotcrm#2651).

Reach (measured once). hotcrm main 89c4d999, @objectstack/* 18.6.0, objectstack dev on a scratch SQLite DB, demo data:

  1. PATCH /api/v1/packages/app.objectstack.hotcrm.service/disable → 200.
  2. GET /api/v1/data/crm_case/<id of CASE-00005> → 404 OBJECT_PACKAGE_DISABLED, "belongs to a disabled package and is not being served".
  3. GET /api/v1/search?q=PDF → 200, and the hits include crm_case CASE-00005.

Expected: step 3 leaves out objects of a disabled package, the same as the data routes. The console's command palette is app-scoped and does not reach these hits. The leak is through the REST search route.

Seam. runtime:/api/v1/search, which does not consult the package-disabled gate that the data routes apply.

Reader. objectstack triage grades it and routes it to the runtime lane. Not a claim; awaits triage.

Dedupe (search/issues, repo:objectstack-ai/objectstack is:issue, open and closed):

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    First touch: p2 · domain:server · pm:queue. Not a queue jump. Global search still serves a disabled package's records to callers who could read them before; it is not a permission breach. The search door should honour OBJECT_PACKAGE_DISABLED the way every data route does.

  2. added
    domain:server
    pm:queue
    priority:p2
    on Nov 18, 2026
  3. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbP6iSEGkWb5fn8yqd

    Claim: PM loop round 1 · area pkg-2 (lease:pkg-2; the maintainer, verbatim, 2026-11-19T05:04Z project chat: 「再开一个 area:package」; standing 「暂时都只派 p1 p2 的卡」) · 2026-11-19T05:12Z
    Session: session_01Utp6CbP6iSEGkWb5fn8yqd
    Account: os-bill
    Branch: claude/issue-35195-search-disabled-package
    Worktree: objectstack-issue-35195 (os-dev worktree in the pkg-2 container)
    Domain: domain:server
    Seat: repo:objectstack#5
    File surface: packages/metadata-protocol/src/protocol-record-reads.ts (searchAll record sweep and readReferenceTitles), the protocol host type only if the registry member must be declared, a new test file named for this card, root .changeset/. ⛔ packages/rest/**, packages/objectql/**, packages/spec/**. Stop on breach and report.
    Container & model: S, mode:subagent, model: default — no path-derived mandate, effort: high
    Clause-②: yes (narrowing: global search stops returning a disabled package's records, the answer every data route already gives)
    Metadata-protocol: semantic
    Responsibility: platform — searchAll sweeps engine.registry.getAllObjects(), which still lists a disabled package's objects, so GET /api/v1/search returns their records while GET /api/v1/data/<object>/<id> answers 404 OBJECT_PACKAGE_DISABLED; every caller of global search on an environment that disables a package.
    Thread-read: 6980431022
    Premise: holds in code — on origin/main 81c09477: protocol-record-reads.ts searchAll walks getAllObjects() with no isObjectPackageDisabled check; the predicate exists on SchemaRegistry (registry.ts:5149). The dev measures it red first.
    Serial constraints cleared: none — overlap-check.mjs on a probe branch touching protocol-record-reads.ts: 0 open PR heads share the file, base merges cleanly. Seat 4's PR #34910 (#34682) does not touch it.
    Pre-claim lane: domain:server (packages/metadata-protocol/**)
    Pre-claim deps: none named.
    Fold with #34900: no — #34900's door is the sandboxed script ctx.api in packages/runtime (action api), a different seam; one guard would have to sit in the engine, which serves a disabled package's objects by design (action-execution.ts refuseUnexposedDataAction). #34900 stays separate (and queues behind data-1's #35174 on the action api).
    Prior rulings read: runtime,search,returns,disabled,package,records,data,routes,answer,object_package_disabled → 308 hits; none on point (ADR hits are term noise: ADR-0067 D3, ADR-0076 D1, ADR-0081 §3, ADR-0086 D2, ADR-0131 D13, ADR-0027 §3, ADR-0029 D1); triage 6980431022 sets the expected answer; thread: none
    Lease: lease:pkg-2

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 19, 2026
  5. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

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

    {
     "issue": 35195,
     "status": "done",
     "branch": "claude/issue-35195-search-disabled-package",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35367",
     "head": "cc13fef3",
     "session": "session_01Utp6CbP6iSEGkWb5fn8yqd",
     "premise_still_valid": true,
     "summary": "searchAll (GET /api/v1/search) now skips any object for which isObjectOfDisabledPackage(registry, name) is true, beside the exposure decision: never queried, named, counted in totalObjects, nor asked of canReadObject; an explicit objects= naming it answers like a nonexistent object (no 404). readReferenceTitles asks the same predicate of a lookup title target, so an enabled hit titled through a disabled package's record keeps the bare id. Pages unchanged: the page sweep reads getMetaItems, which already omits a disabled package's items. Changeset minor for @objectstack/metadata-protocol with BREAKING banner and ADR-0087 not-required marker.",
     "readings": {
      "A1": "holds: at 81c09477 searchAll iterates this.engine.registry.getAllObjects() with no disabled-package check; red on main through the real searchAll (ablation of the new guard: 3 of 8 red).",
      "A2": "reachable in code: an enabled object whose nameField is a reference into a disabled package's object read the target title rows through readReferenceTitles. Fixed by treating the target as unreadable (bare id kept); ablation of that guard: 1 of 8 red, title 'PDF export fails' leaked instead of 'case_5'.",
      "A3": "before: the object was swept like any other (rows returned). After: silently left out; objects=[disabled] deep-equals objects=[nonexistent] (EMPTY answer). Nothing in code or docs says a 404 is owed; the protocol.ts docblock already states 'An explicit objects= naming an unreadable object answers exactly as one naming an object that does not exist'.",
      "A4": "a disabled package's pages are NOT returned: the page sweep reads getMetaItems({type:'page'}), which filters with isItemOfDisabledPackage (protocol-meta-list-reads.ts, the non-package, non-keepDisabledPackages branch). Read from code, not measured through a door. No card needed.",
      "A5": "MetadataHostEngine.registry is typed any (host-engine.ts), so no declaration; the guard reuses the exported optional reader isObjectOfDisabledPackage from protocol-authoring-refusals.ts (registry without the method hides nothing, pinned by a control)."
     },
     "files_changed": [
      "packages/metadata-protocol/src/protocol-record-reads.ts (+17)",
      "packages/metadata-protocol/src/protocol.search-disabled-package-35195.test.ts (new, 8 cases)",
      ".changeset/35195-search-disabled-package.md (new)"
     ],
     "line_budget": "n/a, no skills/** or ratcheted ledger touched",
     "tests": "head cc13fef3. metadata-protocol whole package: vitest run --maxWorkers=2 -> Test Files 359 passed | 9 skipped (368), Tests 23226 passed | 45 skipped (23271), lock VERDICT command-exit 0. build + typecheck (tsc --noEmit, tsconfig includes src/**/* so the test is compiled): VERDICT command-exit 0. New file + 4 neighbour search suites: 5 files, 57 tests passed. Ablation via scripts/ablation-replace.mjs (test imports ./protocol.js from source, no dist leg): sweep guard deleted (anchor 1->0, blob e880bb73d891->b9abfc1b7690) -> Tests 3 failed | 5 passed; title-target guard deleted (anchor 1->0, blob e880bb73d891->99290a4a9d50) -> Tests 1 failed | 7 passed; both restored with blob == HEAD and git diff HEAD empty. Direction observed: turn red, as predicted.",
     "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack: 67 families derived at cc13fef3, 67 run, --ran reconciliation exit 0 (67 accounted, 0 NOT-MEASURED claimed). 63 exit 0 first pass; check-plugin-teardown-shape --self-test exit 3 (shallow clone, pinned fixture) -> fetched that commit -> exit 0 (48 cases); check:lean-entry-closure exit 3 (objectql dist absent) -> after dogfood closure build exit 0; check:type-check-debt exit 3 (lock busy with dogfood) -> rerun exit 0 (0 raw tsc errors); check:dual-build-cjs-loads exit 3 NOT MEASURED (77 dist trees absent; needs full pnpm build) - CI Lint & Repo Gates carries it. check-platform-checklist --changed-from origin/main exit 0 (0 anchored files). overlap-check --branch=HEAD VERDICT clean exit 0 before each push and before pr_create (vs origin/main 24cc61fa). PR check-runs: in_progress at report time, not awaited.",
     "dogfood_battery": "cc13fef3 · os-verify-lock VERDICT command-exit 0 (held 2560s) · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · no failures",
     "mcp_calls": "0",
     "api_writes": "2 relay strokes: (1) pr_create = POST /repos/objectstack-ai/objectstack/pulls (draft forced) + POST /repos/objectstack-ai/objectstack/issues/35367/assignees [os-bill], run 44472354397 success, body read back identical 7865 bytes; (2) this os-dev-report comment via post-stamped.mjs = POST /repos/objectstack-ai/objectstack/issues/35195/comments. git push x3 (not REST).",
     "deviations": [
      "Commit trailers: the spawn prompt asked for 'Co-Authored-By: Claude Opus 5.5'; AGENTS.md requires the model-free pair (Claude-Session + 'Co-authored-by: Claude') and says no model identifier lands in commits, so the model-free pair was used; check:commit-card-trailers passed on push.",
      "Did not merge origin/main before pr_create: main moved 9 commits (81c09477 -> 24cc61fa), none in packages/metadata-protocol or objectql registry (they touch packages/spec validation-message, driver-sql, ui/, skills/); overlap-check reports a clean merge; local suites and dogfood are at the 81c09477 base. PR CI runs on the merge ref.",
      "Metadata-protocol measured on the diff reads 'none' to me (no key, value, type, default or meaning an author writes moves; the moved answer is a runtime door's object set). The claim's 'semantic' line was copied verbatim into PR body and changeset per os-dev.md, and the changeset level is minor accordingly; if the seat re-rules 'none', the level drops to patch.",
      "Search contract docblock in protocol.ts (searchAll method) not updated: outside the card's file fence; reasoning sits at the guard. Noted in Acceptance notes.",
      "First pnpm install failed on better-sqlite3 (node-gyp gyp_main.py Permission denied in pnpm's own temp tool dir, environmental); a second install --frozen-lockfile exited 0."
     ],
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed (read-only inference, no reach): servesExpansionTarget in protocol-query-validation.ts judges an $expand target only by canServeApiOperation, not by isObjectPackageDisabled; whether GET /data/:object?$expand into a disabled package's object serves its fields was not measured. Dedupe words: expand disabled package, OBJECT_PACKAGE_DISABLED expand, servesExpansionTarget",
      "carrier: none · noted, not filed (stale comment, polish): protocol-meta-list-reads.ts cites protocol.package-disable-enforcement.test.ts, which does not exist in packages/metadata-protocol/src."
     ]
    }
  6. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

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

    {
     "issue": 35195,
     "status": "done",
     "delta": "L1-a required change applied",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35367",
     "head": "7e8e4e8a",
     "commits": [
      "6179bc10 changeset: Metadata-protocol semantic -> none, level minor -> patch (BREAKING banner, ADR-0087 marker and text unchanged)",
      "7e8e4e8a merge origin/main (git merge, no rebase; clean, delta vs main still exactly the 3 card files)"
     ],
     "pr_body": "issue_patch via relay run 44477600371: Metadata-protocol line -> none (no 'minor' in body), signed trailer appended as last line; read back identical 7945 bytes",
     "tests": "after merge, closure rebuilt; 7 search suites in metadata-protocol (incl. the card's file): Test Files 7 passed (7), Tests 70 passed (70), lock VERDICT command-exit 0",
     "gates": "changeset families derived by dispatch-gates: check-adr-0087-registration --base origin/main exit 0 (exemption notice read), its --self-test exit 0, check-changeset-no-major --base origin/main exit 0, check-empty-changeset --base origin/main exit 0, its --self-test exit 0, pnpm check:changeset-gate-self-tests exit 0; overlap-check --branch=HEAD VERDICT clean exit 0; one push",
     "ci": "at 7e8e4e8a when read: 44 check-runs, 5 success, 18 skipped, 21 in_progress, 0 failure; not awaited",
     "dogfood_battery": "not re-run at 7e8e4e8a (follow-up order scoped re-checks to the search tests and changeset gates); last battery green at cc13fef3",
     "api_writes": "2: PATCH /repos/objectstack-ai/objectstack/issues/35367 (relay issue_patch); POST /repos/objectstack-ai/objectstack/issues/35195/comments (this comment). git push x1",
     "mcp_calls": "0",
     "security_findings": "none"
    }
  7. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

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

    {
     "issue": 35195,
     "status": "done",
     "delta": "Check Changeset red at 7e8e4e8a diagnosed; no change needed",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35367",
     "head": "7e8e4e8a",
     "root_cause": "Ordering race, not a changeset defect. Job 135401677731 was fired by the push (synchronize) at 07:10:26Z. It read the PR body while the body still said 'Metadata-protocol: semantic' (the relay body patch, run 44477600371, landed after the push). The gate's text: 'The metadata-protocol declaration and the changeset level disagree, inside one PR ... metadata-protocol line: Metadata-protocol: semantic ... 2. The level is right and the Metadata-protocol: LINE is wrong -> correct the line at the producer: a change that adds, narrows or re-means nothing an author writes is none, at patch.' So none at patch is a legal combination. The body edit fired the 'edited' trigger (pr-automation.yml), and that Check Changeset run, 135402106349 (07:11:28Z), concluded success.",
     "changes": "none: no commit, no push, no body write; the changeset and body already carry L1-a's ruling",
     "ci": "at 7e8e4e8a: 24 success, 18 skipped, 12 in_progress, 1 failure = the superseded push-event Check Changeset 135401677731; the same check from the edited event, 135402106349, is success",
     "api_writes": "1: POST /repos/objectstack-ai/objectstack/issues/35195/comments (this comment)",
     "mcp_calls": "0",
     "security_findings": "none"
    }
  8. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

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

    {
     "issue": 35195,
     "status": "done",
     "delta": "dogfood battery pinned to the L2 PASS head",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35367",
     "head": "7e8e4e8a",
     "dogfood_battery": "7e8e4e8aa12129e28635c1f2ade5c552c2b963cc (7e8e4e8a) · detached worktree at that exact head, no commits, no push · pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test under os-verify-lock, no OS_TEST_SHARD, no path · VERDICT command-exit 0 (held 2314s) · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · no failures",
     "api_writes": "1: POST /repos/objectstack-ai/objectstack/issues/35195/comments (this comment)",
     "mcp_calls": "0",
     "security_findings": "none"
    }
  9. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbP6iSEGkWb5fn8yqd

    Closed-out · area pkg-2 · 2026-11-19T09:11Z

    reading value
    PR #35367 MERGED through the merge queue as ee40658d0d (Fixes #35195; this card closed completed)
    contract record L1-a ACCEPT 7002253154; contract review PASS 7003145171; dogfood battery at the landed head (7003944529)

    Delivered: GET /api/v1/search leaves out every object of a disabled package (never queried, named or counted; ?objects= naming one answers as a name with no object), and a lookup title pointing into a disabled package keeps the bare id. Re-enabling the package brings the hits back.
    Follow-up: #35427 (sub-issue: $expand and a relation-condition $filter still serve a disabled package's rows through an enabled object's lookup), p2, area pkg-2.
    State: pm:dispatched and lease:pkg-2 removed; card closed. needs:contract-review removed from PR #35367 (PASS on record, PR merged).

  10. removed
    pm:dispatched
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:packagedomain:serverpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions