Repository navigation
feat(spec): ask-question envelope for the question card, with legacy ask_which reading - #37930
Conversation
Claude-Session: https://claude.ai/code/session_01L9qibvQHY8a6PKzfR6E7SD Co-authored-by: Claude <noreply@anthropic.com>
…are its dropped refinements Claude-Session: https://claude.ai/code/session_01L9qibvQHY8a6PKzfR6E7SD Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvQHY8a6PKzfR6E7SD Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvQHY8a6PKzfR6E7SD Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check24 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1ec515b6b1d6e773119cad58cc4d0626d7158299 && git checkout 1ec515b6b1d6e773119cad58cc4d0626d7158299
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ad632a23a8cadbe8cfae8f1c3fee1052defada29 a8d843b398bb67c6bbac2719943e599cf8f9b01c && git checkout -B drift-repro ad632a23a8cadbe8cfae8f1c3fee1052defada29 && git merge --no-ff a8d843b398bb67c6bbac2719943e599cf8f9b01c
node scripts/docs-audit/affected-docs.mjs --json ad632a23a8cadbe8cfae8f1c3fee1052defada29 |
…ts two new rows Claude-Session: https://claude.ai/code/session_01L9qibvQHY8a6PKzfR6E7SD Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T12:56Z — the brief handed to the isolated contract reviewer whose record follows, posted for the seat to read before adopting it. Contract review brief — PR #37930 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: Read, not reviewed: Check-runs on this head: 70 in total, 60 success, 10 skipped, 0 failed. Test Core (10 shards), Build Core, TypeScript Type Check, Lint & Repo Gates, Spec property liveness, Check Changeset, Governed Surface Queue Guard, Type Check UI and Test UI are all success. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T12:58Z 席位核对 — L1 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-27T13:02Z · zone
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46003823620 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Re-queue · 2026-11-27T13:32Z · zone
|
…dded The new schemas move packages/spec/authorable-surface/ai.json, so the part is a metadata-protocol addition graded minor, as for #37930. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibw1AHBDKuYXJdbT1PN
repo:objectstack#3 · os-tesla · session_01L9qibvQHY8a6PKzfR6E7SD
Requested by Tesla · project thread
Fixes #37872
Clause-②: yes
Metadata-protocol: added
Skills-docs: none — the envelope is a tool result between the AI service's question tool and the console's chat; no skill teaches tool-result envelopes, and nobody authors one as metadata
维护者速读
What changes
New module
packages/spec/src/ai/ask-question.zod.ts, exported from@objectstack/spec/ai:AskQuestionEnvelopeSchema—{ success: true, status: 'asked', reply, preface?, questions };questionsis 1–2 ofAskQuestionSchema({ header?, question, options }),optionsis 2–4 ofAskQuestionOptionSchema({ label, description?, recommended? }). Limits exactly as the card states (preface 80, header 16, question 120, label 24, description 60), exported asASK_QUESTION_LIMITSso the card component and the producer read the same numbers. Labels unique within a question (compared trimmed), at most onerecommended. Every level is closed (strictObject): an unknown key is refused, never dropped. Blank strings are refused.parseAskQuestionEnvelope(value)— takes the already-unwrapped object (peeling the stream's text wrapper stays with the console'sparseResultEnvelope), answers the parsed envelope ornull.{ success: true, status: 'asked_which', question, readings, reply }reads as one question whose options are the readings with no description. The converted value is held to the sameAskQuestionEnvelopeSchema, so one contract and one set of limits; a legacy result the card cannot draw answersnulland stays text as today. The legacy reader is open (extra keys ignored) and not exported: it reads a shape an existing producer writes and stored conversations hold.ASK_QUESTION_STATUS,ASK_WHICH_LEGACY_STATUS; typesAskQuestionEnvelope/AskQuestion/AskQuestionOptionand their…Parsedpairs (ADR-0122).api-surface/,export-origins/,declaration-map/,json-schema.manifest/,authorable-surface/,content/docs/references/**, the strictness-ledger counts.llms.txtinventory count forai16 → 17.dropped-refinements.baseline.json: two new rows (ai/AskQuestionroot,ai/AskQuestionEnvelopequestions.element). The unique-label and single-recommended rules aresuperRefines over object items, which no arm of the closed projection list covers (unique-itemsis scalar-only), so the published JSON Schema is wider than the runtime there; the build printed the rows and they are declared as it asks.Tests
packages/spec/src/ai/ask-question.test.ts, 17 cases: full shape round-trips; unknown key refused at all three levels; status / success literals; reply empty or missing; 1 and 2 questions pass, 0 and 3 refused; 2–4 options pass, 1 and 5 refused; every length limit at max and max+1 with its path; blank question and empty label; duplicate labels (including a trailing-space duplicate) refused within a question and allowed across questions; one recommended passes, two refused; the parser on a valid envelope, on contract breaks, on garbage (null,undefined, strings, numbers, arrays,{}, another status, the un-peeled text wrapper); legacy conversion, legacy extra keys, legacy over the limits (1 or 5 readings, duplicates, an over-long reading), malformed legacy (success false, readings not a string array, missing reply or question). Refusal legs assert zod's issue code and path.Acceptance notes
AskQuestionEnvelopeand carries its limits. If the cloudask_whichreadings commonly exceed 24 characters or 4 entries, stage 1 shows fewer cards than hoped (they stay text, no regression). The cloud producer is outside this session's repositories: reading lengths and the exact legacy key set (ask-which.tool.ts:116) are NOT MEASURED here and rest on the card's Fable-checked citation.Metadata-protocol: addedis copied from the claim; the envelope is a wire shape rather than authored metadata, so theminorlevel follows the kind as declared.parseAskQuestionEnvelopeis a pure parse helper inpackages/spec, as the card asks; precedentparseFilterAST,parseDateMacroParam.Verification
Two-minute check:
pnpm --filter @objectstack/spec exec vitest run src/ai/ask-question.test.ts— 17 passed.Read first:
packages/spec/src/ai/ask-question.zod.ts(thesuperRefineonAskQuestionSchemaandparseAskQuestionEnvelope), thendropped-refinements.baseline.json.Local, head a8d843b:
@objectstack/specbuild,check:generated(all 14 artifacts current),typecheck, vitestsrc/ai+src/shared+ the ADR-0122 pin (65 files, 1634 tests) andscripts(81 files, 1656 tests) green. Derived gate list: 109 commands, 101 exit 0,check:llms-txtfixed in this PR, 7 exit 3 (prerequisite not built on this clone: NOT MEASURED locally, all covered by CI). CI on a8d843b: 70 check-runs, 60 success, 10 skipped, 0 failed. Full report: the os-dev-report comment on 问题卡专题 Q1:spec 问题信封(AskQuestionEnvelope、兼容旧 asked_which、parseAskQuestionEnvelope) #37872.Generated by Claude Code