Skip to content

os db orphans: a detail whose controlled-by-parent master is optional is never swept for dangling master references #30976

Closed

Description

@objectstack-fleet

domain:server#1 · os-elon-musk · session_016WV4cytLmJxfAmgPVjUbbW

Filing gate: ① a named location, from the dev report on #30905 (comment 6685276956, out-of-scope finding); ruling A on #30905 is record 6687830530. ⛔ Not a claim.

PR #30940 (card #30905) lets a controlled_by_parent object declare an optional master (required: false). packages/cli/src/utils/orphan-detail-sweep.ts keeps its findings to isControlledByParentMasterField (about :24-27, :130, :138), which reads a REQUIRED master. So on a detail whose master is optional, a row that still names a master that no longer exists is not reported by os db orphans, though a null master is legitimate there and a dangling one is not. (Read, not reproduced.)

Wanted: the sweep covers optional-master details too, reporting a non-null master reference whose target row is gone and leaving null-master rows alone. A test pins both.

Suggested grade: p3, domain:server. Serial: after PR #30940 lands (it adds the optional master and may change isControlledByParentMasterField's callers).

Activity

  1. added
    bugSomething isn't working
    domain:serverDomain lane — seat card indexed by label:pm:seat
    pm:blockedBlocked by another issue/PR — body carries Blocked-by: #N
    on Nov 6, 2026
  2. objectstack-fleet commented on Nov 6, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: audit · p3 · domain:server · pm:blocked · 2026-11-06T15:57Z

    ⛔ Not a claim.


    Generated by Claude Code

  3. added
    pm:queueReady for the PM dispatch loop
    and removed
    pm:blockedBlocked by another issue/PR — body carries Blocked-by: #N
    on Nov 7, 2026
  4. objectstack-fleet commented on Nov 7, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: unblock · pm:blocked → pm:queue · 2026-11-07T16:17Z

    ⛔ Not a claim.


    Generated by Claude Code

  5. objectstack-fleet commented on Nov 7, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-project-manager · session_01FEkQ5o8PE7ZtVjcor51wBZ

    Claim: PM loop round 1 · 2026-11-07T17:17Z
    Session: session_01FEkQ5madiyLr75cvc8cS31 (card thread, dev) · seat session_01FEkQ5o8PE7ZtVjcor51wBZ
    Account: os-project-manager
    Branch: claude/project-thread-cq3jl8
    Worktree: objectstack-issue-30976
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/cli/src/utils/orphan-detail-sweep.ts + its test, root .changeset/; ⛔ packages/spec/**
    Container & model: S, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate), effort: thread default (order asked medium; the coordinator sets effort only on the maintainer's word)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: packages/cli orphan sweep (objectstack) | none | os db orphans users with an optional controlled-by-parent master (valid since PR #30940)
    Thread-read: 6709696272
    Premise: holds (read, not run): the sweep still keys on isControlledByParentMasterField on origin/main bd5a443c; Blocked-by: #30905 closed; the dev re-measures the predicate first
    Serial constraints cleared: none — no pm:dispatched card claims this file

    Scope: Fixes #30976. Order: /mnt/project-files/pm-orders/server/order-30976.md. Summons: the maintainer's 「server 再开两个座位」「并发都是5」 (this project, 2026-11-07); grading per 「定级你可以自己决定」 is triage's here (graded on the card).

  6. added
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:queueReady for the PM dispatch loop
    on Nov 7, 2026
  7. objectstack-fleet commented on Nov 7, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-project-manager · session_01FEkQ5madiyLr75cvc8cS31

    os-dev-report
    {
    "issue": 30976,
    "status": "done",
    "branch": "claude/project-thread-cq3jl8",
    "pr": "#31226",
    "head": "ec530681",
    "session": "session_01FEkQ5madiyLr75cvc8cS31",
    "premise_still_valid": true,
    "summary": "Premise measured on origin/main 658d84f: isControlledByParentMasterField answers master_detail && required === true only, and PR #30940 added controlledByParentMasterOf beside it for the optional master; the sweep called only the former. The sweep now judges master fields through one local predicate, masterFieldsOf: every required master_detail (unchanged), plus, on a controlled_by_parent object, the optional master controlledByParentMasterOf answers (optional: true). A dangling optional master is an orphan (reported; deleted with its cascade under --delete after the export); an empty optional master is never a finding, because the dangling-reference audit treats null/undefined/'' as no link. A lone required:false master_detail on a non-cbp object, or one beside a required master, stays otherDangling. No packages/spec edit: the spec predicate already exists. Command text and docs that said 'required master-detail master' were made true again. Assignee: not touched.",
    "tests": "On head ec53068: orphan-detail-sweep.test.ts + orphans.integration.test.ts + orphans.no-auto-run.test.ts: Test Files 3 passed (3), Tests 25 passed (25). cli --project unit on 0967087 (main merge; ec53068 adds only six module-top imports to the integration file): 396/398 files passed, 5595 passed | 29 skipped; the 2 failed files were published-subpath-console/hook-body pins refusing 'packages/cli is not built', and after pnpm --filter @objectstack/cli build they ran 2/2 files, 29/29 tests. pnpm --filter @objectstack/cli typecheck (tsc + check:test-typecheck) exit 0. Ablation 1 (ablation-replace --delete of 'if (master?.optional === true) out.push(master.field);', anchor 1->0, blob 7e854c86->766c6ecb): unit+integration files 8 failed | 10 passed (18), e.g. 'expected [] to deeply equal [ { object: sw_optional, ...(3) } ]' and integration 'expected [ od_member, od_member_note, ...(1) ] to include od_tip'; the required-master CONTROL case stayed green; restored, blob == HEAD, git diff HEAD empty. Ablation 2 (negative pin, cbp limit: anchor replaced by 'if (def !== undefined || def?.sharingModel === ...)', blob 7e854c86->9bc35e09): unit file 2 failed | 6 passed (8), 'expected [ master ] to deeply equal []' for sw_optional_private; restored, blob == HEAD. CLI suites import the sweep from src (relative), so no dist leg.",
    "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack: 92 families (same list at 0967087 and ec53068). Run on ec53068, exit codes captured before any pipe: 92/92 exit 0; --ran: '92 derived famil(ies) accounted for — 92 run, 0 NOT-MEASURED'. First round on 0967087: check:test-source-alias exit 1 (edited integration test reached six dynamic imports with no module-top load; fixed in ec53068), and exit 3 PREREQUISITE NOT MET on check-plugin-teardown-shape --self-test (fixed by git fetch --depth=1 origin 621a487), spec check:skill-examples (client/client-react built), check:i18n-coverage (its named closure built), check:dual-build-cjs-loads (measured on round two: 116 entry points across 71 packages load). Scoped lint: root eslint on packages/cli --no-inline-config exit 0 (no lint script in the package). check-platform-checklist --changed-from origin/main exit 0 (0 anchored files). CI families: read from PR #31226 check-runs (in_progress at report time).",
    "gates_ran_file": "/mnt/project-files/pm-orders/server/30976-gates-ran.txt",
    "dogfood_battery": "n/a — no ! in the PR title and Clause-②: no without a (narrowing) arm",
    "line_budget": "6 files, +219 / -62 vs merge base de3996b (sweep 85, sweep unit test 71, integration test 89, orphans.ts 15, cli.mdx 11, changeset 10)",
    "files_changed": [
    ".changeset/30976-orphans-optional-master.md",
    "content/docs/deployment/cli.mdx",
    "packages/cli/src/commands/db/orphans.integration.test.ts",
    "packages/cli/src/commands/db/orphans.ts",
    "packages/cli/src/utils/orphan-detail-sweep.test.ts",
    "packages/cli/src/utils/orphan-detail-sweep.ts"
    ],
    "deviations": [
    "File surface beyond the claim's 'orphan-detail-sweep.ts + its test, root .changeset/': packages/cli/src/commands/db/orphans.ts (description, docblock and human heading said 'required master-detail master', made false by this change) and content/docs/deployment/cli.mdx (the same sentence in the table row and section) — os-dev rule 3, 'a shipped text this round makes false must be fixed'; packages/cli/src/commands/db/orphans.integration.test.ts — the only place the null-master half of the card can fail for real (the unit file's audit is a fake; the real audit is what skips empty values), and editing it obliged six module-top imports from check:test-source-alias.",
    "The integration tier was run locally for the three orphan files only, because the diff edits an integration-tier file; the rest of that tier is declared to CI.",
    "Harness attribution reminder asked for a model-named Co-Authored-By trailer; commits carry the model-free pair per os-dev / pre-push check."
    ],
    "mcp_calls": "2 — mcp__github__issue_read (get, get_comments) on #30976; no MCP write",
    "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/dispatches, run 42402019348 created PR #31226 draft, no labels, no assignees; read-back: 11735 bytes sent, 11735 stored, identical) and this os-dev-report comment via post-stamped.mjs (POST /issues/30976/comments). Plus two git pushes (not REST).",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": [
    "carrier: none — none found; the sibling findings of ruling record 6687830530 (Studio OWD display, Studio authoring of an optional master, D2 docblock) are already the seat's to card and were not touched"
    ]
    }


    Generated by Claude Code

  8. objectstack-fleet commented on Nov 7, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · os-project-manager · session_01FEkQ5o8PE7ZtVjcor51wBZ

    ACCEPT → PR #31226 comment 6711683640 (Head-sha ec53068182). Ready, auto-merge armed; the card closes on merge.

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

Metadata

Metadata

Labels

bugSomething isn't workingdomain:serverDomain lane — seat card indexed by label:pm:seatpm:dispatchedDispatched to a dev agent by /pm-dispatchpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions