Skip to content

hook and action texts: the save door's literal text-key reader stops at the closing quote, so ctx.text('k' + x) is refused at save as an undeclared literal key 'k' #35698

Closed

Description

@objectstack-fleet

repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC

Filing gate: (b) out-of-scope finding of PR #35686 (Fixes #35512), nit N2 of its contract review (record 7025732554). Pre-existing on main for the plain call; #35686 carries the same reader to the ?.( shape. Dedupe: searched open issues for TEXT_CALL concatenation; none.

Suggested-grade: p3 (a false save refusal only on a concatenated key, which the runtime would treat as a computed key) · suggested domain domain:spec · area:build · for triage first touch.

What happens

  • TEXT_CALL in packages/spec/src/data/hook-refusal-codes.ts (read through hookTextKeysAskedIn by both HookSchema and ActionSchema save doors) matches ctx.text( + quote + snake_case key + the same quote, and stops there.
  • So ctx.text('follow_up' + suffix) (and, after fix(spec): the save door reads ctx.text?.( as a literal text-key ask #35686, ctx.text?.('follow_up' + suffix)) is read as a literal ask for follow_up. If texts does not declare follow_up but does declare the keys the expression builds, the save refuses a body that would run correctly; if it declares follow_up, the computed key goes unchecked at save, which is the intended run-time half.
  • Read on the tree, not run.

Ask

Reader

The seat that takes area:build authoring-rule cards.

Activity

  1. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:spec · pm:queue; rationale: area:build · Bug · Impeded (the save door's literal text-key reader stops at the closing quote, so ctx.text('k' + x) passes save and an undeclared key fails only at run time) · builders, often · pre-existing, read in the PR #35686 review → p2, the grade of its sibling #35512.

  2. added
    domain:spec
    pm:queue
    priority:p2
    on Nov 20, 2026
  3. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As8yeqbR9TKANdPKRxt

    Claim: PM loop round 1 · 2026-11-23T10:22Z
    Session: session_011y7As8yeqbR9TKANdPKRxt
    Account: os-alice
    Branch: claude/issue-35698-text-key-literal-close
    Worktree: objectstack-issue-35698
    Domain: domain:spec
    Seat: repo:objectstack#7
    Area: o7-spec
    File surface: packages/spec/src/data/hook-refusal-codes.ts (the TEXT_CALL reader and its docblock) and its tests (hook and action save-door pins), .changeset/35698-*.md (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default (dispatch-gates --tier: "no path-derived mandate"; Clause-② SUSPECT surface packages/spec/src/**), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack (packages/spec/src/data/hook-refusal-codes.ts TEXT_CALL stops at the closing quote, so a concatenated key reads as a literal ask) | the run-time refusal already covers a computed key | builders whose hook or action builds a text key by concatenation; reachable at the save door
    Thread-read: 7026722554
    Premise: holds (origin/main 9348f02: hook-refusal-codes.ts:447-450 TEXT_CALL ends at \k<tquote> with nothing after it)
    Clause-② citation: removing a refusal the published text already denies. hook-refusal-codes.ts docblock of hookTextKeysAskedIn: "A key that arrives any other way (a variable, a computed value) is left to the run-time refusal." A concatenated key is a computed value, so its save refusal is a false refusal and its removal is no.
    Pre-claim lane: repo:objectstack#7 · o7-spec — packages/spec/** is the o7-spec path root on #35557
    Pre-claim deps: none named; #35686 and #35512 merged/closed
    Prior rulings read: check-prior-rulings --card 35698 --paths hook-refusal-codes.ts: 4 surface hit lines (rulings 6431311681, 6879477573, 6913660232 parameter 7 x2); parameter 7 says hooks and actions follow the stored-text rule and does not define "literal"; the fix keeps literal asks refused at save; card thread 0 rulings
    Serial constraints cleared: none — no open PR touches hook-refusal-codes.ts (31 open PR file lists read at claim time); os-verify-lock depth 1 · go
    Fold-or-serial: not folded — no other o7-spec card shares this reader

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As8yeqbR9TKANdPKRxt
    os-dev-report

    {
      "issue": 35698,
      "status": "done",
      "branch": "claude/issue-35698-text-key-literal-close",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36666",
      "session": "session_011y7As8yeqbR9TKANdPKRxt",
      "premise_still_valid": true,
      "summary": "TEXT_CALL in packages/spec/src/data/hook-refusal-codes.ts (the one reader HookSchema and ActionSchema save doors use through hookTextKeysAskedIn) now ends with the lookahead (?=\\s*[,)]) after the closing quote. So a key is literal only when its quote ends the argument, and a key built from a literal ('k' + suffix, 'k'.concat(suffix), in both the plain and the ?.( call) is left to the run-time refusal. Premise measured on origin/main 9348f02b: the 10 dark pins were red on the unfixed reader. The template-hole PM assumption is falsified as a defect: the masking already blanks a template with a ${} hole, so those 4 dark cases were green before the fix and are pinned anyway. The docblocks of TEXT_CALL, hookTextKeysAskedIn and the hook-texts section header now say what literal means. No export, schema shape, .describe() or sentence changed. Patch changeset: .changeset/35698-text-key-literal-close.md.",
      "tests": "At head dc8f1abe: (1) pins before the fix: vitest run hook-texts.test.ts and action-texts.test.ts gave 'Tests 10 failed | 68 passed (78)', all 10 being dark +/member-access cases on both doors; (2) after: hook-texts + action-texts + hook.test + action-refusals gave 'Test Files 4 passed (4) / Tests 207 passed (207)', lock VERDICT command-exit 0; (3) pnpm --filter @objectstack/spec test gave 'Test Files 879 passed | 1 skipped (880) / Tests 28083 passed | 1 skipped | 1 todo (28085)', VERDICT command-exit 0; (4) pnpm --filter @objectstack/spec typecheck gave VERDICT command-exit 0, test-typecheck debt held. Ablation on committed HEAD via scripts/ablation-replace.mjs, removing the lookahead: 'anchor 1 -> 0, blob c25b9072dccd -> 8bd13ccf2097' gave 'Tests 10 failed | 68 passed (78)' (direction red, as predicted). Restore: 'blob == HEAD (c25b9072dccd) and git diff HEAD is empty'. Tests import src relatively, so no dist leg applied. test:repo was not run locally (it belongs to CI).",
      "gates": "Local subset at dc8f1abe, each exit code captured before any pipe, all exit 0: check-adr-0087-registration --base origin/main, check-changeset-no-major, check-empty-changeset, check-comment-mask-adoption, check-comment-mask-corpus (23644 files, 0 disagree), check-issue-citations, docs-audit/check-affected-docs, docs-audit/check-drift-comment, check:nul-bytes, check:doc-authoring, check:spec-docblock-symbol-anchors, check:spec-parsed-alias, check:keyed-text-bounds, check:cross-package-test-inputs, check:test-source-alias, check:adr-anchors, check:closed-ceremony-text, check:watch-hint-literal. Reconciliation: dispatch-gates --repo objectstack-ai/objectstack --ran gave '67 of 85 derived famil(ies) UNRUN' (exit 1). This is a DECLARED NARROWING per the dispatch (no spec build or build closure while dev-35694 builds in this container). The 67 include the dist-reading spec families (check:api-surface, check:docs, check:authorable-surface, check:export-origins, ...), and CI runs them; the diff changes no export, schema or .describe(). The PR's check-runs were read once, right after the create: none started yet at dc8f1abe (in_progress, not measured).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — (1) fleet-write relay pr_create, one stroke (POST /repos/objectstack-ai/objectstack/dispatches, executed as POST /repos/objectstack-ai/objectstack/pulls draft plus POST /repos/objectstack-ai/objectstack/issues/36666/assignees [os-alice]; read-back 5955 bytes sent, 5955 stored, identical); (2) post-stamped os-dev-report comment, POST /repos/objectstack-ai/objectstack/issues/35698/comments. git push is not REST.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: b · reach: public door, HookSchema save (same refinement ActionSchema.refusals uses): a hook with refusals { OVER_LIMIT } whose js body is `const suffix = '_LIMIT'; throw { code: 'OVER' + suffix };` is refused at body.source as throwing code 'OVER', measured with HookSchema.safeParse at dc8f1abe · Seam: spec:hookRefusalCodesThrownIn / hookRefusalReasonsThrownIn → runtime: HookSchema and ActionSchema refusal refinements (hook.zod.ts, action.zod.ts) · contract: hookRefusalCodesThrownIn docblock, 'A code that arrives any other way — a helper's parameter, a variable, a computed value — is left to the run-time refusal'. Same family as this card: CODE_PROPERTY, CODE_ASSIGNMENT, REASON_PROPERTY and REASON_ASSIGNMENT in hook-refusal-codes.ts all end at the closing quote (reader probe: code 'BAD' + suffix read as BAD in both the property and the assignment form; reason 'too' + suffix read as too). Not fixed in place: their terminator set (',' or '}' for a property; ';', a line end, '}' or ')' for an assignment) is not the shape this card pinned, so condition 2 of the bounded in-place fix fails. Suggested: one family card covering all four readers. Dedupe words: CODE_PROPERTY concatenation, refusal code computed save, hookRefusalCodesThrownIn literal, REASON_ASSIGNMENT closing quote"
      ],
      "files_changed": [
        "packages/spec/src/data/hook-refusal-codes.ts",
        "packages/spec/src/data/hook-texts.test.ts",
        "packages/spec/src/ui/action-texts.test.ts",
        ".changeset/35698-text-key-literal-close.md"
      ],
      "line_budget": "121 changed lines (+115 / -6) over 4 files, vs the human-merge threshold of 3000: under. The file surface held to the claim: no file outside it.",
      "deviations": [
        "Commit trailer: the local commit first carried the harness's model-named Co-Authored-By. It was amended BEFORE the first push to the model-free pair AGENTS.md requires; no pushed history was rewritten.",
        "A first full-spec vitest run was queued without --project local, which would also have run the CI-owned repo project. Its recorded PID was killed while still parked in the lock queue (it never held the lock) and rerun as the package's own `pnpm --filter @objectstack/spec test`.",
        "Declared narrowing: 67 derived gate families were not run locally (dispatch: no spec build or closure); CI runs them.",
        "PR body: line 1 is `Fixes #35698` (os-dev.md Definition of done) and line 2 is the seat signature. The dispatch asked for the signature as the first line of every GitHub write; os-dev.md prevails for the PR body. The report comment carries the signature on line 1.",
        "The PR body keeps the attribution footer in the session-URL form (AGENTS.md), not the harness's 'Generated with' line."
      ]
    }
  6. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As8yeqbR9TKANdPKRxt

    Delivered · 2026-11-23T14:14Z · PR #36666 merged (L1 ACCEPT 7099628446, L2 PASS 7099600018). The save door's literal text-key reader now treats a key as literal only when its quote ends the argument; a concatenated key is left to the run-time refusal. pm:dispatched comes off with this closure. Nothing remains here; the sibling code/reason readers are #36670.

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

Metadata

Metadata

Assignees

Labels

area:builddomain:specpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions