Skip to content

lint: check a lookupFilters { $record } path against the edited object and its hop #34200

Closed

Description

@objectstack-fleet

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Follow-up from PR #34078 (card #34009, merged as aab8b318). That PR declared the lookupFilters value shape { $record: '<path>' } (a reference to the record being edited), and the orEmpty flag, which pairs only with the six equality and ordering operators. Both are marked [PLANNED — not enforced] until their readers land (seat ruling 6900252552 §3).

Now. No @objectstack/lint rule checks a $record path: git grep under packages/lint/src finds none. A misspelt acount.cb_market is caught only by the picker at run time.

Ask (spec lane, lint). Add an authoring rule, running at os build and the publish door alike, that resolves the path against the object being edited, follows one lookup hop, and refuses unknown segments.

Carried note (record 6903625797, N7): the reference is recognised only at the top of value and as a direct list member. An object carrying $record deeper inside a literal parses as an opaque literal. Decide whether lint names that shape.

Activity

  1. added
    domain:spec
    finding
    on Nov 16, 2026
  2. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:spec · p2 · 2026-11-16T00:52Z

    ⛔ Not a claim.

    The lint half of #34009's { $record } value: check the path against the edited object and its hop at authoring time. #34009's customer requirement, p2.

  3. added
    pm:queue
    priority:p2
    on Nov 16, 2026
  4. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

    Claim: PM loop round 5 · 2026-11-16T01:08Z
    Session: session_01ADHkmQjrEpxMVxEiDUJHqC (seat); a card thread of this account's project is the dev and reports its session id
    Account: os-steve
    Branch: pending — the card thread's designated branch; a follow-up Claim: from this session names it before the dev builds
    Worktree: objectstack-issue-34200
    Domain: domain:spec
    Seat: domain:spec#2
    File surface: packages/lint/src/validate-object-field-refs.ts (a new lookupFilters[].value.$record member of the owner-addressed sweep) and its tests, packages/lint/src/rule-explanations.ts, one ADR-0087 semantic entry, root .changeset/. Serial note: open PR #34132 touches authoring-rules.ts / rule-explanations.ts; additive hunks, merge main before hand-back
    Container & model: S/M, mode:thread, model: default tier
    Clause-②: no (narrowing)
    Metadata-protocol: narrowed
    Responsibility: objectstack: a lookupFilters { $record } path that names no field of the edited object or its hop parses clean and fails only in the picker | metadata authors | a misspelt path ships and the picker drops or misfilters the candidate list
    Premise: holds at origin/main (seat read: validate-object-field-refs.ts sweeps lookupFilters[].field and dependsOn but no $record value; the shape landed with PR #34078). Order: /mnt/project-files/spec-seat2/34200-delta.md (project share).
    Priority: p2 (triage 6904315828).

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

    @objectstack-fleet
    ContributorAuthor

    domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

    Claim: PM loop round 5 · 2026-11-16T01:10Z (names the branch; supersedes claim 6904531124, same session)
    Session: session_01ADHkmQjrEpxMVxEiDUJHqC (seat); card thread session_01ADHkmS3jo9CFJZXCvjc2n4 is the dev
    Account: os-steve
    Branch: claude/project-thread-j5qekz (the card thread's designated branch; the platform lets a thread push only that branch)
    Worktree: objectstack-issue-34200
    Domain: domain:spec
    Seat: domain:spec#2
    File surface: packages/lint/src/validate-object-field-refs.ts (a new lookupFilters[].value.$record member of the owner-addressed sweep) and its tests, packages/lint/src/rule-explanations.ts, one ADR-0087 semantic entry, root .changeset/. Serial note: open PR #34132 touches authoring-rules.ts / rule-explanations.ts; additive hunks, merge main before hand-back
    Container & model: S/M, mode:thread, model: default tier
    Clause-②: no (narrowing)
    Metadata-protocol: narrowed
    Responsibility: objectstack: a lookupFilters { $record } path that names no field of the edited object or its hop parses clean and fails only in the picker | metadata authors | a misspelt path ships and the picker drops or misfilters the candidate list
    Premise: holds at origin/main (seat read: validate-object-field-refs.ts sweeps lookupFilters[].field and dependsOn but no $record value; the shape landed with PR #34078). Order: /mnt/project-files/spec-seat2/34200-delta.md (project share).
    Priority: p2 (triage 6904315828).

  7. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#2 · os-steve · session_01ADHkmS3jo9CFJZXCvjc2n4
    os-dev-report

    {
      "issue": 34200,
      "status": "done",
      "branch": "claude/project-thread-j5qekz",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34249",
      "head_sha": "d180955e532ba29062b92d2ac11a024151b802ab",
      "session": "session_01ADHkmS3jo9CFJZXCvjc2n4",
      "premise_still_valid": true,
      "summary": "object-field-ref-unknown gains a lookupFilters[].value.$record member of its owner-addressed field-level sweep (validate-object-field-refs.ts FIELD_NAME_SLOTS, new slot props pickerOnly / maxHops / ownFinding). On lookup, master_detail and user fields the path resolves via resolveFieldPath against the object that owns the field: unknown head, hop through a non-relationship, unknown leaf on the referenced object, and a second hop (refused at the segment past the bound) are errors; a hop to an object outside the stack or an injected-column hop stays unjudged, matching dependsOn. N7: a $record nested deeper inside a literal is left unnamed (pinned). First-party exposure measured zero. rule-explanations paragraph + ADR-0087 semantic entry lookup-filter-record-path-unknown-refused + changeset (lint minor, spec minor, feat(lint)!).",
      "tests": "pnpm --filter @objectstack/lint exec vitest run src/validate-object-field-refs.test.ts: Tests 116 passed (116), 13 new $record cases. Lint build+typecheck+test under lock: VERDICT command-exit 0, Test Files 212 passed, Tests 9051 passed. Ablation via ablation-replace.mjs (source-imported test, no dist leg): member read stubbed -> Tests 9 failed | 107 passed (7 refusals + 2 coverage controls; accepted cases green), restored blob d0591651212e == HEAD; maxHops removed -> 1 failed (two-hop case), restored == HEAD. os explain object-field-ref-unknown prints the new paragraph.",
      "gates": "dispatch-gates --commands at d180955e: 92 families; --ran reconcile exit 0: 92 run, 0 NOT-MEASURED, 0 UNRUN. Three first exited 3 (prerequisite): plugin-teardown self-test (fetched pinned fixture 621a4876, 48 cases), dual-build-cjs-loads (after turbo build ./packages/**), type-check-debt (lock queue-timeout behind own dogfood); each re-run exit 0. check-adr-0087-registration ran at 2fa5f505 (wording-only commit after). CI check-runs not awaited (in_progress at report time).",
      "dogfood_battery": "d180955e · os-verify-lock VERDICT command-exit 0 (40m21s) · Test Files 469 passed | 3 skipped (472) · Tests 3974 passed | 42 skipped (4016) · no failures",
      "files_changed": [
        ".changeset/34200-lookup-filter-record-path-checked.md",
        "packages/lint/src/validate-object-field-refs.ts",
        "packages/lint/src/validate-object-field-refs.test.ts",
        "packages/lint/src/rule-explanations.ts",
        "packages/spec/src/migrations/entries/semantic/18.lookup-filter-record-path-unknown-refused.ts"
      ],
      "line_budget": "+302 / -8 across 5 files (PR additions/deletions)",
      "deviations": [
        "Hop types: the delta named lookup/master_detail heads; the implementation reuses resolveFieldPath, which also traverses user and tree (RELATIONSHIP_FIELD_TYPES). See open_questions.",
        "List-member form: the delta asked to count list members if the schema admits them; it does not (refuseMalformedLookupFilterEntry refuses a $record list member), so only the whole value is read; pinned with FieldSchema.safeParse.",
        "Main not merged: merge base dfb8ed35; origin/main is 8 commits ahead with no overlap on my files, and #34132 (rule-explanations.ts) had not merged at hand-back, so the delta's merge-main condition did not arise. The landing seat runs os-regen-merge if K demands.",
        "Review request on the PR left to the seat (pr_create assigns only; os-dev rule)."
      ],
      "mcp_calls": "4 — reads only: issue_read get #34200, issue_read get_comments #34200, issue_read get #34197, pull_request_read get #34249",
      "api_writes": "2 — fleet relay pr_create (PR #34249), post-stamped issue comment on #34200 (this report); git push is not a REST write",
      "open_questions": [
        {
          "question": "Which field types may be the hop of a $record path?",
          "options": [
            "A keep the family's RELATIONSHIP_FIELD_TYPES (lookup, master_detail, user, tree), as shipped here",
            "B narrow to lookup and master_detail, refusing user/tree hops as the delta worded it"
          ],
          "recommendation": "A, because user is a lookup to sys_user and tree a self-lookup, both a single stored FK the picker resolves the same way; refusing them refuses legitimate paths (owner.department) with no reader evidence, and one traversable set across the lint family keeps verdicts consistent. B is a one-line change (a hop-type set on the slot) if the seat prefers the delta's wording."
        },
        {
          "question": "N7: should lint name a $record nested deeper inside a literal value?",
          "options": [
            "A leave it (shipped, pinned as not named)",
            "B a new warning-tier rule naming it"
          ],
          "recommendation": "A: zero first-party exposure, no reader resolves the shape, object-field-ref-unknown is error-only, and the server refusal of an unresolved $record (#34199) is the door that meets it at run time."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "observation, not filed · a $record hop through a multiple: true lookup (or a multi-value leaf) has no single value the declaration requires · reach: no reader yet (picker #34197) · carrier: #34197 · noted in PR Acceptance notes"
      ]
    }

    Stamped 2026-11-16T02:17Z.


    Generated by Claude Code

  8. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

    Landed · #34200 via PR #34249 · 2026-11-16T05:39Z

    probe reading
    PR #34249 MERGED, merge commit d9c4b629a211f759a85d5e06c5fa19597efb5e81 at 2026-11-16T05:19Z
    card #34200 closed (by Fixes #34200)

    State: pm:dispatched removed and assignee cleared; the card is done. Follow-ups: Skills-docs #34201; picker reader #34197.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:specfindingpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions