Skills optimization flight — skills/objectstack-query: RESTRUCTURE (≈ −4,088 tok, −33%) — seven rules stated twice across SKILL.md and rules/, 27% of tokens on an aggregation surface with zero app-author call sites, context (74 real usages) taught nowhere, and the canonical expand example expands nothing #14302

Description

@os-litant

Member card of the skills catalog optimization program #14292 (maintainer mandate 2026-09-02, verbatim: 「审核所有的 skills,进行全面的优化。」). Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1). Read-only audit at objectstack origin/maina59f78d. The full findings table is the audit record: the dev posts it verbatim as the first comment on this card at claim time (seat scratchpad audit/objectstack-query/findings.md).

Audit summary

6 files, 12,270 tokens (SKILL.md 5,443 · aggregation.md 2,226 · filters.md 2,144 · pagination.md 1,381 · evals 558 · generated 518); total headroom 255. Real usage: 6 patterns. Option-key frequency in real query literals: where 169 · context 34 · fields 17 · orderBy 15 · expand 15 · search 12 · aggregations 9; in examples/apps .find 29, .count 0, .aggregate 0, context/...ctx 40. The package spends 27% (3,327 tok) on the aggregation cluster and zero on context. Verdict RESTRUCTURE: SKILL.md and rules/* restate seven rules near-verbatim; ~1,180 tokens are other packages' anchors; the package never states its own calling convention, so its most-copied example shape ({ object: 'account', … }) is not passable to any engine method (ENGINE_FIND_OPTION_KEYS rejects unlisted keys).

Top findings

idspanproposalΔ
QRY-B-01SKILL.md:214-231≡filters.md:100-115 + 6 more pairsMERGE-INTO rules/* — SKILL.md keeps one-line pointers−1,100
QRY-D-01SKILL.md:274-279,327-337,440-445,550-558; aggregation.md:16-27,138-144,156-166; pagination.md:12-18,218-222REWRITE-AS-CONSTRUCT — one 6-row "removed key → replacement" table; delete the history−700
QRY-D-05evals/README.md:1-38"Planned Evals" never built (DEFERRED, #14296 item 2)−558
QRY-C-01SKILL.md:496-539MERGE-INTO objectstack-data (same heading, prescription, example; :535-537 names data as the anchor)−470
QRY-C-02filters.md:221-258OVERRIDDEN — KEEP: query owns date-macros.zod.ts; ui deletes its copy and points here0
QRY-C-04filters.md:260-280MERGE-INTO objectstack-automation :157-164 (delete + pointer)−330
QRY-C-03SKILL.md:617-632DELETE "CRM Analytics Query Blueprint" — ui's dataset/widget surface−260
QRY-B-02SKILL.md:43-51DELETE "When to Use This Skill"−180
QRY-E-03SKILL.md:60-69,256-266,341-352,407-425 vs :371-377,390-396,604-612ADD calling-convention table — engine find/aggregate (object first arg, legal keys) · protocol findData({object, query}) · nested expand · view filter rule+120
QRY-B-03SKILL.md:32-40DELETE "Skill Boundaries"−110
QRY-C-05SKILL.md:624, aggregation.md:199-207DELETE both compareTo copies; ui is the anchor−110
QRY-D-03SKILL.md:20-28DELETE blurb−100
QRY-D-02aggregation.md:88-96DELETE the alias/push-down bug-history parenthesis−95
QRY-F-01absentADD context / system reads — 3 lines + { where, limit: 1, context: SYS }+90
QRY-F-03SKILL.md:136-146, filters.md:18-21ADD $icontains/$like/$ilike + the case-sensitivity rule (filter.zod.ts:548-549)+70

Incidental falsehoods (fix in this flight)

  1. SKILL.md:407-425 — the canonical expand example expands nothing: it projects fields: ['title','status'] while expanding assignee and project, dropping both FK columns; packages/objectql/src/engine.ts:8345-8347 skips a projected-away FK. Contract at packages/spec/src/data/query.zod.ts:509, pinned at query-expression-conformance.test.ts:1575-1586. The Rules list at :427-434 omits the requirement — add it. HIGH.
  2. Sibling: objectstack-ui :1706-1708 "unknown placeholders silently pass through" is FALSE (throws UnknownFilterTokenError) — the ui flight deletes it; this package's filters.md:282-286 is the correct anchor and STAYS.

Flight scope

IMPLEMENT (shrink-only): QRY-B-01 (rules/* are the anchor; SKILL.md keeps one-line pointers — SKILL.md shrinks, rules do not grow), D-01, C-01, C-03, C-04, C-05, B-02, B-03, D-02, D-03, the three funded additions (E-03 paid by B-02+B-03; F-01 paid by C-01; F-03 paid by B-01 in SKILL.md and by deletions in filters.md), falsehood 1, E-02/E-04 corrected examples, QRY-A-01 description edit (regenerate skills/README.md).

ANCHOR RULINGS: this package is the anchor for the filter DSL, date macros / filter tokens (filters.md:221-258 and :282-286 STAY; the ui flight points here — if the ui flight's PR body lists a true row missing here, it becomes a follow-up on this card), pagination, aggregation grammar. Search mirror → anchor objectstack-data (C-01: delete + pointer). Flow-filter rule → anchor objectstack-automation (C-04). compareTo and dataset analytics → anchor objectstack-ui (C-03, C-05).

DEFER (pending #14296): QRY-D-05 / H-02 / H-03 (evals, item 2); QRY-B-05 (generator-owned _index.md headline — the fix is upstream in packages/spec/src/data/query.zod.ts: file the spec-side twin as an out-of-scope card).

Flight constraints (binding)

  • ONE draft PR, first line Fixes #<this card>; governed ⇒ stays draft; review requests are the seat's step.
  • Token ratchet: no ratcheted file may grow; additions paid by deletions in the SAME file; ⛔ re-wrap is not payment; ⛔ no ceiling raise; ⛔ no new files; ⛔ do not touch the ratchet script.
  • ⛔ Never edit another package's files: MERGE-INTO another package = DELETE here + one-line pointer; a missing/weaker anchor goes in the PR body under "follow-up for ".
  • Generated files untouched; frontmatter edits ⇒ regenerate skills/README.md (pnpm --filter @objectstack/spec gen:skill-docs).
  • Live surface with zero measured usage ⇒ one row pointing at its schema, never delete the last mention; retired/tombstoned surface ⇒ delete.
  • A false claim matching a spec .describe() string ⇒ file the spec-side twin as an out-of-scope card.
  • Gates: node scripts/check-skills-token-ratchet.mjs, pnpm --filter @objectstack/spec check:skill-examples, pnpm check:skill-compatibility, pnpm check:skill-identifier-liveness, plus node scripts/pm/dispatch-gates.mjs --commands <changed paths>; record the head sha.
  • PR body: per-item 落点 | before | after list keyed by finding id; per-file token delta; needs:contract-review on both carriers (falsehood 1 and the $icontains rows are contract-semantics claims).

Refs: #14292 · #14296 · #13658.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationdomain:skillspriority:p1High: required for production / M2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
     blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
    }
    } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
    })();
    (function(){
    try {
    var __m = "github.com";
    var __re = new RegExp('^' + "github\\.com" + '
    
    Skip to content

    Skills optimization flight — skills/objectstack-query: RESTRUCTURE (≈ −4,088 tok, −33%) — seven rules stated twice across SKILL.md and rules/, 27% of tokens on an aggregation surface with zero app-author call sites, context (74 real usages) taught nowhere, and the canonical expand example expands nothing #14302

    Description

    @os-litant

    Member card of the skills catalog optimization program #14292 (maintainer mandate 2026-09-02, verbatim: 「审核所有的 skills,进行全面的优化。」). Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1). Read-only audit at objectstack origin/maina59f78d. The full findings table is the audit record: the dev posts it verbatim as the first comment on this card at claim time (seat scratchpad audit/objectstack-query/findings.md).

    Audit summary

    6 files, 12,270 tokens (SKILL.md 5,443 · aggregation.md 2,226 · filters.md 2,144 · pagination.md 1,381 · evals 558 · generated 518); total headroom 255. Real usage: 6 patterns. Option-key frequency in real query literals: where 169 · context 34 · fields 17 · orderBy 15 · expand 15 · search 12 · aggregations 9; in examples/apps .find 29, .count 0, .aggregate 0, context/...ctx 40. The package spends 27% (3,327 tok) on the aggregation cluster and zero on context. Verdict RESTRUCTURE: SKILL.md and rules/* restate seven rules near-verbatim; ~1,180 tokens are other packages' anchors; the package never states its own calling convention, so its most-copied example shape ({ object: 'account', … }) is not passable to any engine method (ENGINE_FIND_OPTION_KEYS rejects unlisted keys).

    Top findings

    idspanproposalΔ
    QRY-B-01SKILL.md:214-231≡filters.md:100-115 + 6 more pairsMERGE-INTO rules/* — SKILL.md keeps one-line pointers−1,100
    QRY-D-01SKILL.md:274-279,327-337,440-445,550-558; aggregation.md:16-27,138-144,156-166; pagination.md:12-18,218-222REWRITE-AS-CONSTRUCT — one 6-row "removed key → replacement" table; delete the history−700
    QRY-D-05evals/README.md:1-38"Planned Evals" never built (DEFERRED, #14296 item 2)−558
    QRY-C-01SKILL.md:496-539MERGE-INTO objectstack-data (same heading, prescription, example; :535-537 names data as the anchor)−470
    QRY-C-02filters.md:221-258OVERRIDDEN — KEEP: query owns date-macros.zod.ts; ui deletes its copy and points here0
    QRY-C-04filters.md:260-280MERGE-INTO objectstack-automation :157-164 (delete + pointer)−330
    QRY-C-03SKILL.md:617-632DELETE "CRM Analytics Query Blueprint" — ui's dataset/widget surface−260
    QRY-B-02SKILL.md:43-51DELETE "When to Use This Skill"−180
    QRY-E-03SKILL.md:60-69,256-266,341-352,407-425 vs :371-377,390-396,604-612ADD calling-convention table — engine find/aggregate (object first arg, legal keys) · protocol findData({object, query}) · nested expand · view filter rule+120
    QRY-B-03SKILL.md:32-40DELETE "Skill Boundaries"−110
    QRY-C-05SKILL.md:624, aggregation.md:199-207DELETE both compareTo copies; ui is the anchor−110
    QRY-D-03SKILL.md:20-28DELETE blurb−100
    QRY-D-02aggregation.md:88-96DELETE the alias/push-down bug-history parenthesis−95
    QRY-F-01absentADD context / system reads — 3 lines + { where, limit: 1, context: SYS }+90
    QRY-F-03SKILL.md:136-146, filters.md:18-21ADD $icontains/$like/$ilike + the case-sensitivity rule (filter.zod.ts:548-549)+70

    Incidental falsehoods (fix in this flight)

    1. SKILL.md:407-425 — the canonical expand example expands nothing: it projects fields: ['title','status'] while expanding assignee and project, dropping both FK columns; packages/objectql/src/engine.ts:8345-8347 skips a projected-away FK. Contract at packages/spec/src/data/query.zod.ts:509, pinned at query-expression-conformance.test.ts:1575-1586. The Rules list at :427-434 omits the requirement — add it. HIGH.
    2. Sibling: objectstack-ui :1706-1708 "unknown placeholders silently pass through" is FALSE (throws UnknownFilterTokenError) — the ui flight deletes it; this package's filters.md:282-286 is the correct anchor and STAYS.

    Flight scope

    IMPLEMENT (shrink-only): QRY-B-01 (rules/* are the anchor; SKILL.md keeps one-line pointers — SKILL.md shrinks, rules do not grow), D-01, C-01, C-03, C-04, C-05, B-02, B-03, D-02, D-03, the three funded additions (E-03 paid by B-02+B-03; F-01 paid by C-01; F-03 paid by B-01 in SKILL.md and by deletions in filters.md), falsehood 1, E-02/E-04 corrected examples, QRY-A-01 description edit (regenerate skills/README.md).

    ANCHOR RULINGS: this package is the anchor for the filter DSL, date macros / filter tokens (filters.md:221-258 and :282-286 STAY; the ui flight points here — if the ui flight's PR body lists a true row missing here, it becomes a follow-up on this card), pagination, aggregation grammar. Search mirror → anchor objectstack-data (C-01: delete + pointer). Flow-filter rule → anchor objectstack-automation (C-04). compareTo and dataset analytics → anchor objectstack-ui (C-03, C-05).

    DEFER (pending #14296): QRY-D-05 / H-02 / H-03 (evals, item 2); QRY-B-05 (generator-owned _index.md headline — the fix is upstream in packages/spec/src/data/query.zod.ts: file the spec-side twin as an out-of-scope card).

    Flight constraints (binding)

    • ONE draft PR, first line Fixes #<this card>; governed ⇒ stays draft; review requests are the seat's step.
    • Token ratchet: no ratcheted file may grow; additions paid by deletions in the SAME file; ⛔ re-wrap is not payment; ⛔ no ceiling raise; ⛔ no new files; ⛔ do not touch the ratchet script.
    • ⛔ Never edit another package's files: MERGE-INTO another package = DELETE here + one-line pointer; a missing/weaker anchor goes in the PR body under "follow-up for ".
    • Generated files untouched; frontmatter edits ⇒ regenerate skills/README.md (pnpm --filter @objectstack/spec gen:skill-docs).
    • Live surface with zero measured usage ⇒ one row pointing at its schema, never delete the last mention; retired/tombstoned surface ⇒ delete.
    • A false claim matching a spec .describe() string ⇒ file the spec-side twin as an out-of-scope card.
    • Gates: node scripts/check-skills-token-ratchet.mjs, pnpm --filter @objectstack/spec check:skill-examples, pnpm check:skill-compatibility, pnpm check:skill-identifier-liveness, plus node scripts/pm/dispatch-gates.mjs --commands <changed paths>; record the head sha.
    • PR body: per-item 落点 | before | after list keyed by finding id; per-file token delta; needs:contract-review on both carriers (falsehood 1 and the $icontains rows are contract-semantics claims).

    Refs: #14292 · #14296 · #13658.

    Metadata

    Metadata

    Assignees

    Labels

    documentationImprovements or additions to documentationdomain:skillspriority:p1High: required for production / M2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
      Skip to content

      Skills optimization flight — skills/objectstack-query: RESTRUCTURE (≈ −4,088 tok, −33%) — seven rules stated twice across SKILL.md and rules/, 27% of tokens on an aggregation surface with zero app-author call sites, context (74 real usages) taught nowhere, and the canonical expand example expands nothing #14302

      Description

      @os-litant

      Member card of the skills catalog optimization program #14292 (maintainer mandate 2026-09-02, verbatim: 「审核所有的 skills,进行全面的优化。」). Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1). Read-only audit at objectstack origin/maina59f78d. The full findings table is the audit record: the dev posts it verbatim as the first comment on this card at claim time (seat scratchpad audit/objectstack-query/findings.md).

      Audit summary

      6 files, 12,270 tokens (SKILL.md 5,443 · aggregation.md 2,226 · filters.md 2,144 · pagination.md 1,381 · evals 558 · generated 518); total headroom 255. Real usage: 6 patterns. Option-key frequency in real query literals: where 169 · context 34 · fields 17 · orderBy 15 · expand 15 · search 12 · aggregations 9; in examples/apps .find 29, .count 0, .aggregate 0, context/...ctx 40. The package spends 27% (3,327 tok) on the aggregation cluster and zero on context. Verdict RESTRUCTURE: SKILL.md and rules/* restate seven rules near-verbatim; ~1,180 tokens are other packages' anchors; the package never states its own calling convention, so its most-copied example shape ({ object: 'account', … }) is not passable to any engine method (ENGINE_FIND_OPTION_KEYS rejects unlisted keys).

      Top findings

      idspanproposalΔ
      QRY-B-01SKILL.md:214-231≡filters.md:100-115 + 6 more pairsMERGE-INTO rules/* — SKILL.md keeps one-line pointers−1,100
      QRY-D-01SKILL.md:274-279,327-337,440-445,550-558; aggregation.md:16-27,138-144,156-166; pagination.md:12-18,218-222REWRITE-AS-CONSTRUCT — one 6-row "removed key → replacement" table; delete the history−700
      QRY-D-05evals/README.md:1-38"Planned Evals" never built (DEFERRED, #14296 item 2)−558
      QRY-C-01SKILL.md:496-539MERGE-INTO objectstack-data (same heading, prescription, example; :535-537 names data as the anchor)−470
      QRY-C-02filters.md:221-258OVERRIDDEN — KEEP: query owns date-macros.zod.ts; ui deletes its copy and points here0
      QRY-C-04filters.md:260-280MERGE-INTO objectstack-automation :157-164 (delete + pointer)−330
      QRY-C-03SKILL.md:617-632DELETE "CRM Analytics Query Blueprint" — ui's dataset/widget surface−260
      QRY-B-02SKILL.md:43-51DELETE "When to Use This Skill"−180
      QRY-E-03SKILL.md:60-69,256-266,341-352,407-425 vs :371-377,390-396,604-612ADD calling-convention table — engine find/aggregate (object first arg, legal keys) · protocol findData({object, query}) · nested expand · view filter rule+120
      QRY-B-03SKILL.md:32-40DELETE "Skill Boundaries"−110
      QRY-C-05SKILL.md:624, aggregation.md:199-207DELETE both compareTo copies; ui is the anchor−110
      QRY-D-03SKILL.md:20-28DELETE blurb−100
      QRY-D-02aggregation.md:88-96DELETE the alias/push-down bug-history parenthesis−95
      QRY-F-01absentADD context / system reads — 3 lines + { where, limit: 1, context: SYS }+90
      QRY-F-03SKILL.md:136-146, filters.md:18-21ADD $icontains/$like/$ilike + the case-sensitivity rule (filter.zod.ts:548-549)+70

      Incidental falsehoods (fix in this flight)

      1. SKILL.md:407-425 — the canonical expand example expands nothing: it projects fields: ['title','status'] while expanding assignee and project, dropping both FK columns; packages/objectql/src/engine.ts:8345-8347 skips a projected-away FK. Contract at packages/spec/src/data/query.zod.ts:509, pinned at query-expression-conformance.test.ts:1575-1586. The Rules list at :427-434 omits the requirement — add it. HIGH.
      2. Sibling: objectstack-ui :1706-1708 "unknown placeholders silently pass through" is FALSE (throws UnknownFilterTokenError) — the ui flight deletes it; this package's filters.md:282-286 is the correct anchor and STAYS.

      Flight scope

      IMPLEMENT (shrink-only): QRY-B-01 (rules/* are the anchor; SKILL.md keeps one-line pointers — SKILL.md shrinks, rules do not grow), D-01, C-01, C-03, C-04, C-05, B-02, B-03, D-02, D-03, the three funded additions (E-03 paid by B-02+B-03; F-01 paid by C-01; F-03 paid by B-01 in SKILL.md and by deletions in filters.md), falsehood 1, E-02/E-04 corrected examples, QRY-A-01 description edit (regenerate skills/README.md).

      ANCHOR RULINGS: this package is the anchor for the filter DSL, date macros / filter tokens (filters.md:221-258 and :282-286 STAY; the ui flight points here — if the ui flight's PR body lists a true row missing here, it becomes a follow-up on this card), pagination, aggregation grammar. Search mirror → anchor objectstack-data (C-01: delete + pointer). Flow-filter rule → anchor objectstack-automation (C-04). compareTo and dataset analytics → anchor objectstack-ui (C-03, C-05).

      DEFER (pending #14296): QRY-D-05 / H-02 / H-03 (evals, item 2); QRY-B-05 (generator-owned _index.md headline — the fix is upstream in packages/spec/src/data/query.zod.ts: file the spec-side twin as an out-of-scope card).

      Flight constraints (binding)

      • ONE draft PR, first line Fixes #<this card>; governed ⇒ stays draft; review requests are the seat's step.
      • Token ratchet: no ratcheted file may grow; additions paid by deletions in the SAME file; ⛔ re-wrap is not payment; ⛔ no ceiling raise; ⛔ no new files; ⛔ do not touch the ratchet script.
      • ⛔ Never edit another package's files: MERGE-INTO another package = DELETE here + one-line pointer; a missing/weaker anchor goes in the PR body under "follow-up for ".
      • Generated files untouched; frontmatter edits ⇒ regenerate skills/README.md (pnpm --filter @objectstack/spec gen:skill-docs).
      • Live surface with zero measured usage ⇒ one row pointing at its schema, never delete the last mention; retired/tombstoned surface ⇒ delete.
      • A false claim matching a spec .describe() string ⇒ file the spec-side twin as an out-of-scope card.
      • Gates: node scripts/check-skills-token-ratchet.mjs, pnpm --filter @objectstack/spec check:skill-examples, pnpm check:skill-compatibility, pnpm check:skill-identifier-liveness, plus node scripts/pm/dispatch-gates.mjs --commands <changed paths>; record the head sha.
      • PR body: per-item 落点 | before | after list keyed by finding id; per-file token delta; needs:contract-review on both carriers (falsehood 1 and the $icontains rows are contract-semantics claims).

      Refs: #14292 · #14296 · #13658.

      Metadata

      Metadata

      Assignees

      Labels

      documentationImprovements or additions to documentationdomain:skillspriority:p1High: required for production / M2

      Type

      No type

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
        Skip to content

        Skills optimization flight — skills/objectstack-query: RESTRUCTURE (≈ −4,088 tok, −33%) — seven rules stated twice across SKILL.md and rules/, 27% of tokens on an aggregation surface with zero app-author call sites, context (74 real usages) taught nowhere, and the canonical expand example expands nothing #14302

        Description

        @os-litant

        Member card of the skills catalog optimization program #14292 (maintainer mandate 2026-09-02, verbatim: 「审核所有的 skills,进行全面的优化。」). Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1). Read-only audit at objectstack origin/maina59f78d. The full findings table is the audit record: the dev posts it verbatim as the first comment on this card at claim time (seat scratchpad audit/objectstack-query/findings.md).

        Audit summary

        6 files, 12,270 tokens (SKILL.md 5,443 · aggregation.md 2,226 · filters.md 2,144 · pagination.md 1,381 · evals 558 · generated 518); total headroom 255. Real usage: 6 patterns. Option-key frequency in real query literals: where 169 · context 34 · fields 17 · orderBy 15 · expand 15 · search 12 · aggregations 9; in examples/apps .find 29, .count 0, .aggregate 0, context/...ctx 40. The package spends 27% (3,327 tok) on the aggregation cluster and zero on context. Verdict RESTRUCTURE: SKILL.md and rules/* restate seven rules near-verbatim; ~1,180 tokens are other packages' anchors; the package never states its own calling convention, so its most-copied example shape ({ object: 'account', … }) is not passable to any engine method (ENGINE_FIND_OPTION_KEYS rejects unlisted keys).

        Top findings

        idspanproposalΔ
        QRY-B-01SKILL.md:214-231≡filters.md:100-115 + 6 more pairsMERGE-INTO rules/* — SKILL.md keeps one-line pointers−1,100
        QRY-D-01SKILL.md:274-279,327-337,440-445,550-558; aggregation.md:16-27,138-144,156-166; pagination.md:12-18,218-222REWRITE-AS-CONSTRUCT — one 6-row "removed key → replacement" table; delete the history−700
        QRY-D-05evals/README.md:1-38"Planned Evals" never built (DEFERRED, #14296 item 2)−558
        QRY-C-01SKILL.md:496-539MERGE-INTO objectstack-data (same heading, prescription, example; :535-537 names data as the anchor)−470
        QRY-C-02filters.md:221-258OVERRIDDEN — KEEP: query owns date-macros.zod.ts; ui deletes its copy and points here0
        QRY-C-04filters.md:260-280MERGE-INTO objectstack-automation :157-164 (delete + pointer)−330
        QRY-C-03SKILL.md:617-632DELETE "CRM Analytics Query Blueprint" — ui's dataset/widget surface−260
        QRY-B-02SKILL.md:43-51DELETE "When to Use This Skill"−180
        QRY-E-03SKILL.md:60-69,256-266,341-352,407-425 vs :371-377,390-396,604-612ADD calling-convention table — engine find/aggregate (object first arg, legal keys) · protocol findData({object, query}) · nested expand · view filter rule+120
        QRY-B-03SKILL.md:32-40DELETE "Skill Boundaries"−110
        QRY-C-05SKILL.md:624, aggregation.md:199-207DELETE both compareTo copies; ui is the anchor−110
        QRY-D-03SKILL.md:20-28DELETE blurb−100
        QRY-D-02aggregation.md:88-96DELETE the alias/push-down bug-history parenthesis−95
        QRY-F-01absentADD context / system reads — 3 lines + { where, limit: 1, context: SYS }+90
        QRY-F-03SKILL.md:136-146, filters.md:18-21ADD $icontains/$like/$ilike + the case-sensitivity rule (filter.zod.ts:548-549)+70

        Incidental falsehoods (fix in this flight)

        1. SKILL.md:407-425 — the canonical expand example expands nothing: it projects fields: ['title','status'] while expanding assignee and project, dropping both FK columns; packages/objectql/src/engine.ts:8345-8347 skips a projected-away FK. Contract at packages/spec/src/data/query.zod.ts:509, pinned at query-expression-conformance.test.ts:1575-1586. The Rules list at :427-434 omits the requirement — add it. HIGH.
        2. Sibling: objectstack-ui :1706-1708 "unknown placeholders silently pass through" is FALSE (throws UnknownFilterTokenError) — the ui flight deletes it; this package's filters.md:282-286 is the correct anchor and STAYS.

        Flight scope

        IMPLEMENT (shrink-only): QRY-B-01 (rules/* are the anchor; SKILL.md keeps one-line pointers — SKILL.md shrinks, rules do not grow), D-01, C-01, C-03, C-04, C-05, B-02, B-03, D-02, D-03, the three funded additions (E-03 paid by B-02+B-03; F-01 paid by C-01; F-03 paid by B-01 in SKILL.md and by deletions in filters.md), falsehood 1, E-02/E-04 corrected examples, QRY-A-01 description edit (regenerate skills/README.md).

        ANCHOR RULINGS: this package is the anchor for the filter DSL, date macros / filter tokens (filters.md:221-258 and :282-286 STAY; the ui flight points here — if the ui flight's PR body lists a true row missing here, it becomes a follow-up on this card), pagination, aggregation grammar. Search mirror → anchor objectstack-data (C-01: delete + pointer). Flow-filter rule → anchor objectstack-automation (C-04). compareTo and dataset analytics → anchor objectstack-ui (C-03, C-05).

        DEFER (pending #14296): QRY-D-05 / H-02 / H-03 (evals, item 2); QRY-B-05 (generator-owned _index.md headline — the fix is upstream in packages/spec/src/data/query.zod.ts: file the spec-side twin as an out-of-scope card).

        Flight constraints (binding)

        • ONE draft PR, first line Fixes #<this card>; governed ⇒ stays draft; review requests are the seat's step.
        • Token ratchet: no ratcheted file may grow; additions paid by deletions in the SAME file; ⛔ re-wrap is not payment; ⛔ no ceiling raise; ⛔ no new files; ⛔ do not touch the ratchet script.
        • ⛔ Never edit another package's files: MERGE-INTO another package = DELETE here + one-line pointer; a missing/weaker anchor goes in the PR body under "follow-up for ".
        • Generated files untouched; frontmatter edits ⇒ regenerate skills/README.md (pnpm --filter @objectstack/spec gen:skill-docs).
        • Live surface with zero measured usage ⇒ one row pointing at its schema, never delete the last mention; retired/tombstoned surface ⇒ delete.
        • A false claim matching a spec .describe() string ⇒ file the spec-side twin as an out-of-scope card.
        • Gates: node scripts/check-skills-token-ratchet.mjs, pnpm --filter @objectstack/spec check:skill-examples, pnpm check:skill-compatibility, pnpm check:skill-identifier-liveness, plus node scripts/pm/dispatch-gates.mjs --commands <changed paths>; record the head sha.
        • PR body: per-item 落点 | before | after list keyed by finding id; per-file token delta; needs:contract-review on both carriers (falsehood 1 and the $icontains rows are contract-semantics claims).

        Refs: #14292 · #14296 · #13658.

        Metadata

        Metadata

        Assignees

        Labels

        documentationImprovements or additions to documentationdomain:skillspriority:p1High: required for production / M2

        Type

        No type

        Projects

        No projects

          Milestone

          No milestone

          Relationships

          None yet

          Development

          No branches or pull requests

          Issue actions

          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
          Skip to content

          Skills optimization flight — skills/objectstack-query: RESTRUCTURE (≈ −4,088 tok, −33%) — seven rules stated twice across SKILL.md and rules/, 27% of tokens on an aggregation surface with zero app-author call sites, context (74 real usages) taught nowhere, and the canonical expand example expands nothing #14302

          Description

          @os-litant

          Member card of the skills catalog optimization program #14292 (maintainer mandate 2026-09-02, verbatim: 「审核所有的 skills,进行全面的优化。」). Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1). Read-only audit at objectstack origin/maina59f78d. The full findings table is the audit record: the dev posts it verbatim as the first comment on this card at claim time (seat scratchpad audit/objectstack-query/findings.md).

          Audit summary

          6 files, 12,270 tokens (SKILL.md 5,443 · aggregation.md 2,226 · filters.md 2,144 · pagination.md 1,381 · evals 558 · generated 518); total headroom 255. Real usage: 6 patterns. Option-key frequency in real query literals: where 169 · context 34 · fields 17 · orderBy 15 · expand 15 · search 12 · aggregations 9; in examples/apps .find 29, .count 0, .aggregate 0, context/...ctx 40. The package spends 27% (3,327 tok) on the aggregation cluster and zero on context. Verdict RESTRUCTURE: SKILL.md and rules/* restate seven rules near-verbatim; ~1,180 tokens are other packages' anchors; the package never states its own calling convention, so its most-copied example shape ({ object: 'account', … }) is not passable to any engine method (ENGINE_FIND_OPTION_KEYS rejects unlisted keys).

          Top findings

          idspanproposalΔ
          QRY-B-01SKILL.md:214-231≡filters.md:100-115 + 6 more pairsMERGE-INTO rules/* — SKILL.md keeps one-line pointers−1,100
          QRY-D-01SKILL.md:274-279,327-337,440-445,550-558; aggregation.md:16-27,138-144,156-166; pagination.md:12-18,218-222REWRITE-AS-CONSTRUCT — one 6-row "removed key → replacement" table; delete the history−700
          QRY-D-05evals/README.md:1-38"Planned Evals" never built (DEFERRED, #14296 item 2)−558
          QRY-C-01SKILL.md:496-539MERGE-INTO objectstack-data (same heading, prescription, example; :535-537 names data as the anchor)−470
          QRY-C-02filters.md:221-258OVERRIDDEN — KEEP: query owns date-macros.zod.ts; ui deletes its copy and points here0
          QRY-C-04filters.md:260-280MERGE-INTO objectstack-automation :157-164 (delete + pointer)−330
          QRY-C-03SKILL.md:617-632DELETE "CRM Analytics Query Blueprint" — ui's dataset/widget surface−260
          QRY-B-02SKILL.md:43-51DELETE "When to Use This Skill"−180
          QRY-E-03SKILL.md:60-69,256-266,341-352,407-425 vs :371-377,390-396,604-612ADD calling-convention table — engine find/aggregate (object first arg, legal keys) · protocol findData({object, query}) · nested expand · view filter rule+120
          QRY-B-03SKILL.md:32-40DELETE "Skill Boundaries"−110
          QRY-C-05SKILL.md:624, aggregation.md:199-207DELETE both compareTo copies; ui is the anchor−110
          QRY-D-03SKILL.md:20-28DELETE blurb−100
          QRY-D-02aggregation.md:88-96DELETE the alias/push-down bug-history parenthesis−95
          QRY-F-01absentADD context / system reads — 3 lines + { where, limit: 1, context: SYS }+90
          QRY-F-03SKILL.md:136-146, filters.md:18-21ADD $icontains/$like/$ilike + the case-sensitivity rule (filter.zod.ts:548-549)+70

          Incidental falsehoods (fix in this flight)

          1. SKILL.md:407-425 — the canonical expand example expands nothing: it projects fields: ['title','status'] while expanding assignee and project, dropping both FK columns; packages/objectql/src/engine.ts:8345-8347 skips a projected-away FK. Contract at packages/spec/src/data/query.zod.ts:509, pinned at query-expression-conformance.test.ts:1575-1586. The Rules list at :427-434 omits the requirement — add it. HIGH.
          2. Sibling: objectstack-ui :1706-1708 "unknown placeholders silently pass through" is FALSE (throws UnknownFilterTokenError) — the ui flight deletes it; this package's filters.md:282-286 is the correct anchor and STAYS.

          Flight scope

          IMPLEMENT (shrink-only): QRY-B-01 (rules/* are the anchor; SKILL.md keeps one-line pointers — SKILL.md shrinks, rules do not grow), D-01, C-01, C-03, C-04, C-05, B-02, B-03, D-02, D-03, the three funded additions (E-03 paid by B-02+B-03; F-01 paid by C-01; F-03 paid by B-01 in SKILL.md and by deletions in filters.md), falsehood 1, E-02/E-04 corrected examples, QRY-A-01 description edit (regenerate skills/README.md).

          ANCHOR RULINGS: this package is the anchor for the filter DSL, date macros / filter tokens (filters.md:221-258 and :282-286 STAY; the ui flight points here — if the ui flight's PR body lists a true row missing here, it becomes a follow-up on this card), pagination, aggregation grammar. Search mirror → anchor objectstack-data (C-01: delete + pointer). Flow-filter rule → anchor objectstack-automation (C-04). compareTo and dataset analytics → anchor objectstack-ui (C-03, C-05).

          DEFER (pending #14296): QRY-D-05 / H-02 / H-03 (evals, item 2); QRY-B-05 (generator-owned _index.md headline — the fix is upstream in packages/spec/src/data/query.zod.ts: file the spec-side twin as an out-of-scope card).

          Flight constraints (binding)

          • ONE draft PR, first line Fixes #<this card>; governed ⇒ stays draft; review requests are the seat's step.
          • Token ratchet: no ratcheted file may grow; additions paid by deletions in the SAME file; ⛔ re-wrap is not payment; ⛔ no ceiling raise; ⛔ no new files; ⛔ do not touch the ratchet script.
          • ⛔ Never edit another package's files: MERGE-INTO another package = DELETE here + one-line pointer; a missing/weaker anchor goes in the PR body under "follow-up for ".
          • Generated files untouched; frontmatter edits ⇒ regenerate skills/README.md (pnpm --filter @objectstack/spec gen:skill-docs).
          • Live surface with zero measured usage ⇒ one row pointing at its schema, never delete the last mention; retired/tombstoned surface ⇒ delete.
          • A false claim matching a spec .describe() string ⇒ file the spec-side twin as an out-of-scope card.
          • Gates: node scripts/check-skills-token-ratchet.mjs, pnpm --filter @objectstack/spec check:skill-examples, pnpm check:skill-compatibility, pnpm check:skill-identifier-liveness, plus node scripts/pm/dispatch-gates.mjs --commands <changed paths>; record the head sha.
          • PR body: per-item 落点 | before | after list keyed by finding id; per-file token delta; needs:contract-review on both carriers (falsehood 1 and the $icontains rows are contract-semantics claims).

          Refs: #14292 · #14296 · #13658.

          Metadata

          Metadata

          Assignees

          Labels

          documentationImprovements or additions to documentationdomain:skillspriority:p1High: required for production / M2

          Type

          No type

          Projects

          No projects

            Milestone

            No milestone

            Relationships

            None yet

            Development

            No branches or pull requests

            Issue actions

            , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
            Skip to content

            Skills optimization flight — skills/objectstack-query: RESTRUCTURE (≈ −4,088 tok, −33%) — seven rules stated twice across SKILL.md and rules/, 27% of tokens on an aggregation surface with zero app-author call sites, context (74 real usages) taught nowhere, and the canonical expand example expands nothing #14302

            Description

            @os-litant

            Member card of the skills catalog optimization program #14292 (maintainer mandate 2026-09-02, verbatim: 「审核所有的 skills,进行全面的优化。」). Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1). Read-only audit at objectstack origin/maina59f78d. The full findings table is the audit record: the dev posts it verbatim as the first comment on this card at claim time (seat scratchpad audit/objectstack-query/findings.md).

            Audit summary

            6 files, 12,270 tokens (SKILL.md 5,443 · aggregation.md 2,226 · filters.md 2,144 · pagination.md 1,381 · evals 558 · generated 518); total headroom 255. Real usage: 6 patterns. Option-key frequency in real query literals: where 169 · context 34 · fields 17 · orderBy 15 · expand 15 · search 12 · aggregations 9; in examples/apps .find 29, .count 0, .aggregate 0, context/...ctx 40. The package spends 27% (3,327 tok) on the aggregation cluster and zero on context. Verdict RESTRUCTURE: SKILL.md and rules/* restate seven rules near-verbatim; ~1,180 tokens are other packages' anchors; the package never states its own calling convention, so its most-copied example shape ({ object: 'account', … }) is not passable to any engine method (ENGINE_FIND_OPTION_KEYS rejects unlisted keys).

            Top findings

            idspanproposalΔ
            QRY-B-01SKILL.md:214-231≡filters.md:100-115 + 6 more pairsMERGE-INTO rules/* — SKILL.md keeps one-line pointers−1,100
            QRY-D-01SKILL.md:274-279,327-337,440-445,550-558; aggregation.md:16-27,138-144,156-166; pagination.md:12-18,218-222REWRITE-AS-CONSTRUCT — one 6-row "removed key → replacement" table; delete the history−700
            QRY-D-05evals/README.md:1-38"Planned Evals" never built (DEFERRED, #14296 item 2)−558
            QRY-C-01SKILL.md:496-539MERGE-INTO objectstack-data (same heading, prescription, example; :535-537 names data as the anchor)−470
            QRY-C-02filters.md:221-258OVERRIDDEN — KEEP: query owns date-macros.zod.ts; ui deletes its copy and points here0
            QRY-C-04filters.md:260-280MERGE-INTO objectstack-automation :157-164 (delete + pointer)−330
            QRY-C-03SKILL.md:617-632DELETE "CRM Analytics Query Blueprint" — ui's dataset/widget surface−260
            QRY-B-02SKILL.md:43-51DELETE "When to Use This Skill"−180
            QRY-E-03SKILL.md:60-69,256-266,341-352,407-425 vs :371-377,390-396,604-612ADD calling-convention table — engine find/aggregate (object first arg, legal keys) · protocol findData({object, query}) · nested expand · view filter rule+120
            QRY-B-03SKILL.md:32-40DELETE "Skill Boundaries"−110
            QRY-C-05SKILL.md:624, aggregation.md:199-207DELETE both compareTo copies; ui is the anchor−110
            QRY-D-03SKILL.md:20-28DELETE blurb−100
            QRY-D-02aggregation.md:88-96DELETE the alias/push-down bug-history parenthesis−95
            QRY-F-01absentADD context / system reads — 3 lines + { where, limit: 1, context: SYS }+90
            QRY-F-03SKILL.md:136-146, filters.md:18-21ADD $icontains/$like/$ilike + the case-sensitivity rule (filter.zod.ts:548-549)+70

            Incidental falsehoods (fix in this flight)

            1. SKILL.md:407-425 — the canonical expand example expands nothing: it projects fields: ['title','status'] while expanding assignee and project, dropping both FK columns; packages/objectql/src/engine.ts:8345-8347 skips a projected-away FK. Contract at packages/spec/src/data/query.zod.ts:509, pinned at query-expression-conformance.test.ts:1575-1586. The Rules list at :427-434 omits the requirement — add it. HIGH.
            2. Sibling: objectstack-ui :1706-1708 "unknown placeholders silently pass through" is FALSE (throws UnknownFilterTokenError) — the ui flight deletes it; this package's filters.md:282-286 is the correct anchor and STAYS.

            Flight scope

            IMPLEMENT (shrink-only): QRY-B-01 (rules/* are the anchor; SKILL.md keeps one-line pointers — SKILL.md shrinks, rules do not grow), D-01, C-01, C-03, C-04, C-05, B-02, B-03, D-02, D-03, the three funded additions (E-03 paid by B-02+B-03; F-01 paid by C-01; F-03 paid by B-01 in SKILL.md and by deletions in filters.md), falsehood 1, E-02/E-04 corrected examples, QRY-A-01 description edit (regenerate skills/README.md).

            ANCHOR RULINGS: this package is the anchor for the filter DSL, date macros / filter tokens (filters.md:221-258 and :282-286 STAY; the ui flight points here — if the ui flight's PR body lists a true row missing here, it becomes a follow-up on this card), pagination, aggregation grammar. Search mirror → anchor objectstack-data (C-01: delete + pointer). Flow-filter rule → anchor objectstack-automation (C-04). compareTo and dataset analytics → anchor objectstack-ui (C-03, C-05).

            DEFER (pending #14296): QRY-D-05 / H-02 / H-03 (evals, item 2); QRY-B-05 (generator-owned _index.md headline — the fix is upstream in packages/spec/src/data/query.zod.ts: file the spec-side twin as an out-of-scope card).

            Flight constraints (binding)

            • ONE draft PR, first line Fixes #<this card>; governed ⇒ stays draft; review requests are the seat's step.
            • Token ratchet: no ratcheted file may grow; additions paid by deletions in the SAME file; ⛔ re-wrap is not payment; ⛔ no ceiling raise; ⛔ no new files; ⛔ do not touch the ratchet script.
            • ⛔ Never edit another package's files: MERGE-INTO another package = DELETE here + one-line pointer; a missing/weaker anchor goes in the PR body under "follow-up for ".
            • Generated files untouched; frontmatter edits ⇒ regenerate skills/README.md (pnpm --filter @objectstack/spec gen:skill-docs).
            • Live surface with zero measured usage ⇒ one row pointing at its schema, never delete the last mention; retired/tombstoned surface ⇒ delete.
            • A false claim matching a spec .describe() string ⇒ file the spec-side twin as an out-of-scope card.
            • Gates: node scripts/check-skills-token-ratchet.mjs, pnpm --filter @objectstack/spec check:skill-examples, pnpm check:skill-compatibility, pnpm check:skill-identifier-liveness, plus node scripts/pm/dispatch-gates.mjs --commands <changed paths>; record the head sha.
            • PR body: per-item 落点 | before | after list keyed by finding id; per-file token delta; needs:contract-review on both carriers (falsehood 1 and the $icontains rows are contract-semantics claims).

            Refs: #14292 · #14296 · #13658.

            Metadata

            Metadata

            Assignees

            Labels

            documentationImprovements or additions to documentationdomain:skillspriority:p1High: required for production / M2

            Type

            No type

            Projects

            No projects

              Milestone

              No milestone

              Relationships

              None yet

              Development

              No branches or pull requests

              Issue actions

              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
              Skip to content

              Skills optimization flight — skills/objectstack-query: RESTRUCTURE (≈ −4,088 tok, −33%) — seven rules stated twice across SKILL.md and rules/, 27% of tokens on an aggregation surface with zero app-author call sites, context (74 real usages) taught nowhere, and the canonical expand example expands nothing #14302

              Description

              @os-litant

              Member card of the skills catalog optimization program #14292 (maintainer mandate 2026-09-02, verbatim: 「审核所有的 skills,进行全面的优化。」). Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1). Read-only audit at objectstack origin/maina59f78d. The full findings table is the audit record: the dev posts it verbatim as the first comment on this card at claim time (seat scratchpad audit/objectstack-query/findings.md).

              Audit summary

              6 files, 12,270 tokens (SKILL.md 5,443 · aggregation.md 2,226 · filters.md 2,144 · pagination.md 1,381 · evals 558 · generated 518); total headroom 255. Real usage: 6 patterns. Option-key frequency in real query literals: where 169 · context 34 · fields 17 · orderBy 15 · expand 15 · search 12 · aggregations 9; in examples/apps .find 29, .count 0, .aggregate 0, context/...ctx 40. The package spends 27% (3,327 tok) on the aggregation cluster and zero on context. Verdict RESTRUCTURE: SKILL.md and rules/* restate seven rules near-verbatim; ~1,180 tokens are other packages' anchors; the package never states its own calling convention, so its most-copied example shape ({ object: 'account', … }) is not passable to any engine method (ENGINE_FIND_OPTION_KEYS rejects unlisted keys).

              Top findings

              idspanproposalΔ
              QRY-B-01SKILL.md:214-231≡filters.md:100-115 + 6 more pairsMERGE-INTO rules/* — SKILL.md keeps one-line pointers−1,100
              QRY-D-01SKILL.md:274-279,327-337,440-445,550-558; aggregation.md:16-27,138-144,156-166; pagination.md:12-18,218-222REWRITE-AS-CONSTRUCT — one 6-row "removed key → replacement" table; delete the history−700
              QRY-D-05evals/README.md:1-38"Planned Evals" never built (DEFERRED, #14296 item 2)−558
              QRY-C-01SKILL.md:496-539MERGE-INTO objectstack-data (same heading, prescription, example; :535-537 names data as the anchor)−470
              QRY-C-02filters.md:221-258OVERRIDDEN — KEEP: query owns date-macros.zod.ts; ui deletes its copy and points here0
              QRY-C-04filters.md:260-280MERGE-INTO objectstack-automation :157-164 (delete + pointer)−330
              QRY-C-03SKILL.md:617-632DELETE "CRM Analytics Query Blueprint" — ui's dataset/widget surface−260
              QRY-B-02SKILL.md:43-51DELETE "When to Use This Skill"−180
              QRY-E-03SKILL.md:60-69,256-266,341-352,407-425 vs :371-377,390-396,604-612ADD calling-convention table — engine find/aggregate (object first arg, legal keys) · protocol findData({object, query}) · nested expand · view filter rule+120
              QRY-B-03SKILL.md:32-40DELETE "Skill Boundaries"−110
              QRY-C-05SKILL.md:624, aggregation.md:199-207DELETE both compareTo copies; ui is the anchor−110
              QRY-D-03SKILL.md:20-28DELETE blurb−100
              QRY-D-02aggregation.md:88-96DELETE the alias/push-down bug-history parenthesis−95
              QRY-F-01absentADD context / system reads — 3 lines + { where, limit: 1, context: SYS }+90
              QRY-F-03SKILL.md:136-146, filters.md:18-21ADD $icontains/$like/$ilike + the case-sensitivity rule (filter.zod.ts:548-549)+70

              Incidental falsehoods (fix in this flight)

              1. SKILL.md:407-425 — the canonical expand example expands nothing: it projects fields: ['title','status'] while expanding assignee and project, dropping both FK columns; packages/objectql/src/engine.ts:8345-8347 skips a projected-away FK. Contract at packages/spec/src/data/query.zod.ts:509, pinned at query-expression-conformance.test.ts:1575-1586. The Rules list at :427-434 omits the requirement — add it. HIGH.
              2. Sibling: objectstack-ui :1706-1708 "unknown placeholders silently pass through" is FALSE (throws UnknownFilterTokenError) — the ui flight deletes it; this package's filters.md:282-286 is the correct anchor and STAYS.

              Flight scope

              IMPLEMENT (shrink-only): QRY-B-01 (rules/* are the anchor; SKILL.md keeps one-line pointers — SKILL.md shrinks, rules do not grow), D-01, C-01, C-03, C-04, C-05, B-02, B-03, D-02, D-03, the three funded additions (E-03 paid by B-02+B-03; F-01 paid by C-01; F-03 paid by B-01 in SKILL.md and by deletions in filters.md), falsehood 1, E-02/E-04 corrected examples, QRY-A-01 description edit (regenerate skills/README.md).

              ANCHOR RULINGS: this package is the anchor for the filter DSL, date macros / filter tokens (filters.md:221-258 and :282-286 STAY; the ui flight points here — if the ui flight's PR body lists a true row missing here, it becomes a follow-up on this card), pagination, aggregation grammar. Search mirror → anchor objectstack-data (C-01: delete + pointer). Flow-filter rule → anchor objectstack-automation (C-04). compareTo and dataset analytics → anchor objectstack-ui (C-03, C-05).

              DEFER (pending #14296): QRY-D-05 / H-02 / H-03 (evals, item 2); QRY-B-05 (generator-owned _index.md headline — the fix is upstream in packages/spec/src/data/query.zod.ts: file the spec-side twin as an out-of-scope card).

              Flight constraints (binding)

              • ONE draft PR, first line Fixes #<this card>; governed ⇒ stays draft; review requests are the seat's step.
              • Token ratchet: no ratcheted file may grow; additions paid by deletions in the SAME file; ⛔ re-wrap is not payment; ⛔ no ceiling raise; ⛔ no new files; ⛔ do not touch the ratchet script.
              • ⛔ Never edit another package's files: MERGE-INTO another package = DELETE here + one-line pointer; a missing/weaker anchor goes in the PR body under "follow-up for ".
              • Generated files untouched; frontmatter edits ⇒ regenerate skills/README.md (pnpm --filter @objectstack/spec gen:skill-docs).
              • Live surface with zero measured usage ⇒ one row pointing at its schema, never delete the last mention; retired/tombstoned surface ⇒ delete.
              • A false claim matching a spec .describe() string ⇒ file the spec-side twin as an out-of-scope card.
              • Gates: node scripts/check-skills-token-ratchet.mjs, pnpm --filter @objectstack/spec check:skill-examples, pnpm check:skill-compatibility, pnpm check:skill-identifier-liveness, plus node scripts/pm/dispatch-gates.mjs --commands <changed paths>; record the head sha.
              • PR body: per-item 落点 | before | after list keyed by finding id; per-file token delta; needs:contract-review on both carriers (falsehood 1 and the $icontains rows are contract-semantics claims).

              Refs: #14292 · #14296 · #13658.

              Metadata

              Metadata

              Assignees

              Labels

              documentationImprovements or additions to documentationdomain:skillspriority:p1High: required for production / M2

              Type

              No type

              Projects

              No projects

                Milestone

                No milestone

                Relationships

                None yet

                Development

                No branches or pull requests

                Issue actions

                , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
                Skip to content

                Skills optimization flight — skills/objectstack-query: RESTRUCTURE (≈ −4,088 tok, −33%) — seven rules stated twice across SKILL.md and rules/, 27% of tokens on an aggregation surface with zero app-author call sites, context (74 real usages) taught nowhere, and the canonical expand example expands nothing #14302

                Description

                @os-litant

                Member card of the skills catalog optimization program #14292 (maintainer mandate 2026-09-02, verbatim: 「审核所有的 skills,进行全面的优化。」). Filed by the skills lane seat (session session_01LraLgQVGq8egUwfYZpbYt1). Read-only audit at objectstack origin/maina59f78d. The full findings table is the audit record: the dev posts it verbatim as the first comment on this card at claim time (seat scratchpad audit/objectstack-query/findings.md).

                Audit summary

                6 files, 12,270 tokens (SKILL.md 5,443 · aggregation.md 2,226 · filters.md 2,144 · pagination.md 1,381 · evals 558 · generated 518); total headroom 255. Real usage: 6 patterns. Option-key frequency in real query literals: where 169 · context 34 · fields 17 · orderBy 15 · expand 15 · search 12 · aggregations 9; in examples/apps .find 29, .count 0, .aggregate 0, context/...ctx 40. The package spends 27% (3,327 tok) on the aggregation cluster and zero on context. Verdict RESTRUCTURE: SKILL.md and rules/* restate seven rules near-verbatim; ~1,180 tokens are other packages' anchors; the package never states its own calling convention, so its most-copied example shape ({ object: 'account', … }) is not passable to any engine method (ENGINE_FIND_OPTION_KEYS rejects unlisted keys).

                Top findings

                idspanproposalΔ
                QRY-B-01SKILL.md:214-231≡filters.md:100-115 + 6 more pairsMERGE-INTO rules/* — SKILL.md keeps one-line pointers−1,100
                QRY-D-01SKILL.md:274-279,327-337,440-445,550-558; aggregation.md:16-27,138-144,156-166; pagination.md:12-18,218-222REWRITE-AS-CONSTRUCT — one 6-row "removed key → replacement" table; delete the history−700
                QRY-D-05evals/README.md:1-38"Planned Evals" never built (DEFERRED, #14296 item 2)−558
                QRY-C-01SKILL.md:496-539MERGE-INTO objectstack-data (same heading, prescription, example; :535-537 names data as the anchor)−470
                QRY-C-02filters.md:221-258OVERRIDDEN — KEEP: query owns date-macros.zod.ts; ui deletes its copy and points here0
                QRY-C-04filters.md:260-280MERGE-INTO objectstack-automation :157-164 (delete + pointer)−330
                QRY-C-03SKILL.md:617-632DELETE "CRM Analytics Query Blueprint" — ui's dataset/widget surface−260
                QRY-B-02SKILL.md:43-51DELETE "When to Use This Skill"−180
                QRY-E-03SKILL.md:60-69,256-266,341-352,407-425 vs :371-377,390-396,604-612ADD calling-convention table — engine find/aggregate (object first arg, legal keys) · protocol findData({object, query}) · nested expand · view filter rule+120
                QRY-B-03SKILL.md:32-40DELETE "Skill Boundaries"−110
                QRY-C-05SKILL.md:624, aggregation.md:199-207DELETE both compareTo copies; ui is the anchor−110
                QRY-D-03SKILL.md:20-28DELETE blurb−100
                QRY-D-02aggregation.md:88-96DELETE the alias/push-down bug-history parenthesis−95
                QRY-F-01absentADD context / system reads — 3 lines + { where, limit: 1, context: SYS }+90
                QRY-F-03SKILL.md:136-146, filters.md:18-21ADD $icontains/$like/$ilike + the case-sensitivity rule (filter.zod.ts:548-549)+70

                Incidental falsehoods (fix in this flight)

                1. SKILL.md:407-425 — the canonical expand example expands nothing: it projects fields: ['title','status'] while expanding assignee and project, dropping both FK columns; packages/objectql/src/engine.ts:8345-8347 skips a projected-away FK. Contract at packages/spec/src/data/query.zod.ts:509, pinned at query-expression-conformance.test.ts:1575-1586. The Rules list at :427-434 omits the requirement — add it. HIGH.
                2. Sibling: objectstack-ui :1706-1708 "unknown placeholders silently pass through" is FALSE (throws UnknownFilterTokenError) — the ui flight deletes it; this package's filters.md:282-286 is the correct anchor and STAYS.

                Flight scope

                IMPLEMENT (shrink-only): QRY-B-01 (rules/* are the anchor; SKILL.md keeps one-line pointers — SKILL.md shrinks, rules do not grow), D-01, C-01, C-03, C-04, C-05, B-02, B-03, D-02, D-03, the three funded additions (E-03 paid by B-02+B-03; F-01 paid by C-01; F-03 paid by B-01 in SKILL.md and by deletions in filters.md), falsehood 1, E-02/E-04 corrected examples, QRY-A-01 description edit (regenerate skills/README.md).

                ANCHOR RULINGS: this package is the anchor for the filter DSL, date macros / filter tokens (filters.md:221-258 and :282-286 STAY; the ui flight points here — if the ui flight's PR body lists a true row missing here, it becomes a follow-up on this card), pagination, aggregation grammar. Search mirror → anchor objectstack-data (C-01: delete + pointer). Flow-filter rule → anchor objectstack-automation (C-04). compareTo and dataset analytics → anchor objectstack-ui (C-03, C-05).

                DEFER (pending #14296): QRY-D-05 / H-02 / H-03 (evals, item 2); QRY-B-05 (generator-owned _index.md headline — the fix is upstream in packages/spec/src/data/query.zod.ts: file the spec-side twin as an out-of-scope card).

                Flight constraints (binding)

                • ONE draft PR, first line Fixes #<this card>; governed ⇒ stays draft; review requests are the seat's step.
                • Token ratchet: no ratcheted file may grow; additions paid by deletions in the SAME file; ⛔ re-wrap is not payment; ⛔ no ceiling raise; ⛔ no new files; ⛔ do not touch the ratchet script.
                • ⛔ Never edit another package's files: MERGE-INTO another package = DELETE here + one-line pointer; a missing/weaker anchor goes in the PR body under "follow-up for ".
                • Generated files untouched; frontmatter edits ⇒ regenerate skills/README.md (pnpm --filter @objectstack/spec gen:skill-docs).
                • Live surface with zero measured usage ⇒ one row pointing at its schema, never delete the last mention; retired/tombstoned surface ⇒ delete.
                • A false claim matching a spec .describe() string ⇒ file the spec-side twin as an out-of-scope card.
                • Gates: node scripts/check-skills-token-ratchet.mjs, pnpm --filter @objectstack/spec check:skill-examples, pnpm check:skill-compatibility, pnpm check:skill-identifier-liveness, plus node scripts/pm/dispatch-gates.mjs --commands <changed paths>; record the head sha.
                • PR body: per-item 落点 | before | after list keyed by finding id; per-file token delta; needs:contract-review on both carriers (falsehood 1 and the $icontains rows are contract-semantics claims).

                Refs: #14292 · #14296 · #13658.

                Metadata

                Metadata

                Assignees

                Labels

                documentationImprovements or additions to documentationdomain:skillspriority:p1High: required for production / M2

                Type

                No type

                Projects

                No projects

                  Milestone

                  No milestone

                  Relationships

                  None yet

                  Development

                  No branches or pull requests

                  Issue actions