You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filing gate: ③ maintainer-directed (topic #36996 handed to this project), from the #37173 contract review, R7 (comment 7149757761). ADR-0160 D1 says author defects are "reported at save and by os validate". #37173 ships the os validate half only.
Grading: area:ai · Feature · p2 (must land before row 7, the Studio form, #37143) · evidence: read.
维护者速读
背景:资料包写错了,比如字段名拼错、关联列表指向不存在的对象,现在只有命令行 os validate 会报。在运行时或 Studio 里存的资料包,错了没人告诉作者,AI 读到的就是少了几项的资料。
要做的:保存资料包时就跑同一套检查,把错误告诉作者。
要你做的:无。
What
Wire validateAiContext (packages/lint/src/validate-ai-context.ts, CLI-only today, authoring-rules.ts) into the runtime metadata save path for ai_context. It needs a read of the object schema snapshot the rule judges against.
A save with a defect answers the same rule ids and messages that os validate prints. Decide, and state in the PR, whether a save with a defect is refused or saved with warnings, following the precedent other kinds set at save.
get_record_context stays silent on author defects; this card does not change the tool.
Acceptance
A runtime-created pack with a misspelled field or an unknown related object reports the defect at save. Pin each rule family.
Claim: PM loop round 4 (area:ai zone ai-A, topic #36996 non-cloud rows) · 2026-11-25T05:54Z
Session: session_01WGufzi13yZRqVcp2mGonWK
Account: os-support-ai
Branch: claude/issue-37176-ai-context-save-time-errors
Worktree: objectstack-issue-37176
Domain: domain:server
Seat: repo:objectstack#3
Area: ai-A
File surface: packages/lint/src/runtime-gate.ts (one TYPE_TO_STACK_KEY row, ai_context: 'aiContexts', amended after the dev's measurement: an unmapped runtime type builds no snapshot); packages/lint/src/authoring-rules.ts (the validateAiContext row's surfaces / surfaceReason, :1972) and packages/lint/src/validate-ai-context.ts only if the runtime input needs a seam; packages/metadata-protocol/src/** (the runtime authoring gate, protocol-authoring-gate.ts / protocol-save.ts, and the object-schema snapshot the rule judges against, following the stored-universe precedent); tests in new card-named files unless AGENTS.md's shared-harness rule says otherwise; the REST/client save-response type only if the save answer gains a member; .changeset/. ⛔ get_record_context and packages/services/service-record-context/** are not changed (card What 3).
Container & model: M, mode:subagent, model: default, effort: high
Clause-②: no (measured by the dev: the publish door's precedent is saved-with-warnings, protocol-save.ts:1871 and :2416-2437; findings ride the existing advisories member, no member is added and nothing is refused; amended from the claim-time widest reading yes)
Metadata-protocol: none
Responsibility: n/a — not a defect card
Thread-read: 7152193724
Premise: holds. Measured at a03c3d4: validateAiContext is registered as an advisory rule with surfaces: CLI_ONLY, surfaceReason: RUNTIME_NEEDS_FULL_SNAPSHOT (packages/lint/src/authoring-rules.ts:1966-1980), so only os validate reports it; its four verdicts are all warning (validate-ai-context.ts:14-24). The runtime authoring gate runs other rules at save (packages/metadata-protocol/src/protocol-authoring-gate.ts; tests protocol.runtime-authoring-gate.test.ts, protocol.runtime-gate-stored-universe.test.ts), which is the precedent the card asks the PR to follow and state.
Serial constraints cleared: #37173 (#37140) merged 03:39Z. This zone's open PRs (#37209 docs/adr, #37202 docs/adr, #37222 service-record-context) share no file. The overlap check runs at the first push.
Pre-claim lane: domain:server (packages/lint, packages/metadata-protocol); a save-answer type edit, if any, stays here by the lane-keep rule and owes the L2 in L1-w.
Pre-claim deps: #37140 merged (PR #37173)
Prior rulings read: check-prior-rulings.mjs --card 37176 at a03c3d4: ai_context → 2 hits; ADR-0160 D1 ("reported at save and by os validate"), ADR-0160 D8; thread: none; none conflicting
Done when: a runtime-created pack with a misspelled field, an unknown related object, a related list with no link, or a non-long-text body reports the same rule id and message at save that os validate prints, one pin per rule family; the PR states refused vs saved-with-warnings by the precedent; it lands before #37143 (row 7).
{
"issue": 37176,
"status": "done",
"branch": "claude/issue-37176-ai-context-save-time-errors",
"pr": "https://github.com/objectstack-ai/objectstack/pull/37247",
"session": "session_01WGufzi13yZRqVcp2mGonWK",
"premise_still_valid": true,
"summary": "validateAiContext now runs on the runtime publish door for ai_context: the registry row is CLI_AND_RUNTIME with runtimeTypes ['ai_context'] (authoring-rules.ts:1980), and TYPE_TO_STACK_KEY gains ai_context: 'aiContexts' (runtime-gate.ts:312). No metadata-protocol src change: the host already gathers live objects for every gated type. Precedent: saved with warnings, not refused. protocol-save.ts:1871 (gate errors thrown as the 422, advisories ride the 2xx) and :2416-2437 (conditional advisories key), as every advisory rule on the door does (validateRetiredPermissionResidue :2440, validateEmailTemplateDefaultArguments :3208). So Clause-2 is measured 'no' (the existing advisories member, no new member, nothing refused) and Metadata-protocol stays 'none'. One file-surface breach is declared, not hidden: the claim named authoring-rules.ts and validate-ai-context.ts, and the crossing also needs the one TYPE_TO_STACK_KEY row in packages/lint/src/runtime-gate.ts. A declared runtime type with no mapping builds no snapshot, and authoring-rule-wiring.test.ts refuses it. overlap-check was clean at every push. Remote branch head fa24633d (merge of origin/main onto 090e4c01).",
"tests": "New pins: validate-ai-context.test.ts gets a top-level describe, 6 cases. Each of the 4 rule families (misspelled field, unknown related object, related list with no link, non-long-text body) gives no error, exactly one advisory with that rule and path, and rule/severity/where/path/message/hint equal to runAuthoringRules('validate') over the same pack; a clean pack earns nothing. protocol.runtime-authoring-gate.test.ts (the shared saveMetaItem harness) gets a top-level describe, 6 cases through the real saveMetaItem: each family is persisted with success:true and advisories equal to os validate's rule/where/message/hint, a clean pack has no advisories key, and a draft save is not judged. Package runs at 090e4c01: lint test 235/235 files, 9626/9626 tests, exit 0; lint typecheck exit 0; metadata-protocol test 370 passed + 9 skipped files, 23418 passed + 45 skipped tests, exit 0; metadata-protocol typecheck exit 0. The merge to fa24633d brought only packages/spec/src/ai/record-context-tools.zod.ts into these closures. Ablation at 090e4c01, through scripts/ablation-replace.mjs with an EXIT trap restore: runtimeTypes ['ai_context'] became ['ablated_ai_context'] (grep injected 1 / original 0), lint rebuilt, ablation-dist-preflight found the marker in 4 dist files. Lint describe 6 failed / 6 passed of 12; door describe 5 failed / 1 passed of 6 (the clean-pack case passes either way). Restore: blob == HEAD 239859dc, git diff HEAD empty, rebuilt, preflight --absent clean, then green 12/12 and 6/6.",
"gates": "Local: dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at fa24633d derived 65 families; each was run with its exit code captured before any pipe. 61 exit 0. NOT MEASURED: check-plugin-teardown-shape --self-test (exit 3, shallow checkout cannot read its pinned fixture), check:dual-build-cjs-loads and check:lean-entry-closure (exit 3, need a whole-repo build), check:query-options-erasure (124, repo-wide ESLint scan hit the local 300s cap). --ran reconciliation: 65 derived, 65 run, 0 UNRUN. test:repo was not run locally (CI Test Core owns it). CI on PR head fa24633d: started, 23 check-runs at open (5 completed, 15 in_progress, 3 queued), mergeable_state blocked (draft and required checks, not dirty). Conclusions in_progress at report time.",
"dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls, draft, assignee os-support-ai; read-back 7087 bytes identical) = PR #37247; post-stamped os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/37176/comments). git push is not counted.",
"open_questions": [
{
"question": "Ratify the file-surface addition packages/lint/src/runtime-gate.ts (one TYPE_TO_STACK_KEY row, ai_context: 'aiContexts'), which the claim did not name?",
"options": [
"A ratify: the row is the runtime-input seam the crossing cannot exist without (unmapped runtime type = no snapshot, refused by authoring-rule-wiring.test.ts); the claim's surface line is amended",
"B refuse: the PR is withdrawn to a needs_decision on a different seam (none exists that keeps one rule list; running the rule outside AUTHORING_RULES would be a second runtime rule list, which runtime-gate.ts's header rules out)"
],
"recommendation": "A, because the row is a one-line data edit in the table the claim's own crossing writes into, overlap-check was clean, and there is no alternative seam that keeps one rule registry."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: none · noted, not filed: on a write naming a package with readable dependencies, objects is narrowed to that package's closure, so a pack naming another package's object outside the closure is told ai-context-object-unknown in the words os validate uses for an object its stack does not hold (no ctx.packageScope wording in validateAiContext). In the PR's Acceptance notes; not a defect class (the CLI answers identically)."
]
}
{
"issue": 37176,
"status": "done",
"branch": "claude/issue-37176-ai-context-save-time-errors",
"pr": "https://github.com/objectstack-ai/objectstack/pull/37247",
"session": "session_01WGufzi13yZRqVcp2mGonWK",
"premise_still_valid": true,
"summary": "Round 2 (L1 REWORK 7155741340, S1). validateAiContext now takes the write's package scope, as validateFlowTriggerReadiness does: run: (stack, ctx) => validateAiContext(stack, ctx.packageScope ? { packageScope: ctx.packageScope } : {}). Under a scope in force, ai-context-object-unknown is worded for the closure ('outside the closure of package \"P\" ..., so the pack reads nothing of it where the package is installed without that dependency'). Its hint is closureDependencyRemedy(name, packageId, 'name an object inside that closure'). Severity stays warning, and the unscoped os validate wording is unchanged. The authoring-rules.ts comment no longer says 'the snapshot cannot invent a finding'; it now states the closure narrowing and the remedy. A replacement PR body is ready for the coordinator to send: body file pr-body-r2.md and a one-action issue_patch file actions-r2.json, dry-run exit 0. New head 59f26fac (origin/main merged at 8c4ede01; fix 0a363d54; test rename 59f26fac). CI is all green on it and mergeable_state is clean. Test UI red on 0a363d54 was not this change: its 16 shards concluded 'cancelled' at 07:57:11 because the 59f26fac push superseded the run (ci.yml:115-117, concurrency group per PR number with cancel-in-progress: true). Test UI on 59f26fac is success, so no rerun was spent.",
"tests": "New pins. validate-ai-context.test.ts: (a) under packageScope {app.policy, deps []}, an installed object owned by com.other is told the closure message (not 'this stack does not define') with the exact closureDependencyRemedy hint, and declaring the dependency clears it; (b) unscoped message and hint pinned verbatim. protocol.runtime-authoring-gate.test.ts, through the real saveMetaItem: a pack saved with packageId 'app.fx' (installed, no deps) naming 'account', owned by com.example.pages, is persisted with success:true, advisory ai-context-object-unknown at aiContexts[0].related[0].object, the closure message and the exact remedy. With no package, an unknown object keeps the os validate rule/where/message/hint. Package runs at 59f26fac: lint test 235/235 files and 9628/9628 tests, exit 0; lint typecheck exit 0; protocol.runtime-authoring-gate.test.ts 259 passed; metadata-protocol typecheck exit 0. The full metadata-protocol suite was last run at 090e4c01 (23418 passed); round 2 changed only the test file in that package. Scope ablation, with an EXIT trap restore: 'const closure = options.packageScope;' was replaced with a read of an unset global (marker __ablated_scope__, injected 1 / original 0), lint rebuilt, and dist-preflight found the marker in 4 files. Exactly the two scoped pins went red: lint 1 failed of 14, door 1 failed of 8. Restore: blob == HEAD 689cc794, rebuilt, preflight --absent clean, then 14/14 and 8/8. A first ablation attempt spelled its marker as an expression esbuild rewrites; dist-preflight could not see it, so that reading is void and not counted.",
"gates": "Local at 59f26fac: dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 65 families; all 65 run, --ran reconciles 65 of 65, 0 UNRUN. 61 exit 0: check:type-check-debt hit the 300s cap in the batch and was rerun alone, exit 0, 0 raw tsc errors. NOT MEASURED: check-plugin-teardown-shape --self-test (exit 3, the shallow checkout cannot read its pinned fixture); check:dual-build-cjs-loads and check:lean-entry-closure (exit 3, they need a whole-repo build); check:query-options-erasure (124, the repo-wide ESLint scan hit the local cap). CI on PR head 59f26fac: 68 check-runs, 57 success, 11 skipped, 0 failed; Lint & Repo Gates, TypeScript Type Check, Test Core and Test UI are all success; mergeable_state clean.",
"dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
"mcp_calls": "0",
"api_writes": "1 this round — post-stamped os-dev-report comment, POST /repos/objectstack-ai/objectstack/issues/37176/comments. The PR body issue_patch was prepared and dry-run only; the coordinator sends it. git push is not counted. Round 1 made 2 writes (pr_create #37247 and a report comment).",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": []
}
Close-out · 2026-11-25T09:44Z · PR #37247 merged 2026-11-25T09:43Z as 376377c, ahead of #37143; this card closed by Fixes. pm:dispatched removed. A save of ai_context metadata now runs validateAiContext at the runtime authoring gate (same rule ids and messages as os validate; under a package, the closure remedy). Nothing else open on this card.
Activity
objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: first touch 2026-11-25T02:35Z
Featureset. The filer's area:ai · p2 andpm:queueare kept. It is a topic 专题:记录范围 AI 问询(在一条记录上问 AI:对话钉在这条记录上、平台按配置交给模型这条记录的资料、外部 AI 经 MCP 拿到同一份) #36996 follow-up of 记录 AI 问询 5:资料包类型 ai_context、渲染服务与 get_record_context 工具(MCP) #37140, from the feat(ai): ai_context context packs and the get_record_context tool over MCP (ADR-0160 row 5) #37173 contract review.ai_contextpacks · read · size S.objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: blocked 2026-11-25T03:04Z (repo:objectstack#3's request 7151547806)
Blocked-by: #37173
pm:queue→pm:blocked. This card builds on code that so far exists only in the cloud seat's open PR feat(ai): ai_context context packs and the get_record_context tool over MCP (ADR-0160 row 5) #37173 (记录 AI 问询 5:资料包类型 ai_context、渲染服务与 get_record_context 工具(MCP) #37140):validate-ai-context.ts,@objectstack/service-record-context,get_record_contextand theai_contextskill keys. None of it is on main at 3b4f0b9.objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: unblocked 2026-11-25T03:43Z
pm:blocked→pm:queue. Its blocker PR feat(ai): ai_context context packs and the get_record_context tool over MCP (ADR-0160 row 5) #37173 merged at 2026-11-25T03:39Z, and 记录 AI 问询 5:资料包类型 ai_context、渲染服务与 get_record_context 工具(MCP) #37140 is closed.objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK
Claim: PM loop round 4 (area:ai zone ai-A, topic #36996 non-cloud rows) · 2026-11-25T05:54Z
Session:
session_01WGufzi13yZRqVcp2mGonWKAccount:
os-support-aiBranch:
claude/issue-37176-ai-context-save-time-errorsWorktree:
objectstack-issue-37176Domain:
domain:serverSeat:
repo:objectstack#3Area: ai-A
File surface:
packages/lint/src/runtime-gate.ts(oneTYPE_TO_STACK_KEYrow,ai_context: 'aiContexts', amended after the dev's measurement: an unmapped runtime type builds no snapshot);packages/lint/src/authoring-rules.ts(thevalidateAiContextrow'ssurfaces/surfaceReason, :1972) andpackages/lint/src/validate-ai-context.tsonly if the runtime input needs a seam;packages/metadata-protocol/src/**(the runtime authoring gate,protocol-authoring-gate.ts/protocol-save.ts, and the object-schema snapshot the rule judges against, following the stored-universe precedent); tests in new card-named files unless AGENTS.md's shared-harness rule says otherwise; the REST/client save-response type only if the save answer gains a member;.changeset/. ⛔get_record_contextandpackages/services/service-record-context/**are not changed (card What 3).Container & model: M, mode:subagent, model: default, effort: high
Clause-②: no (measured by the dev: the publish door's precedent is saved-with-warnings, protocol-save.ts:1871 and :2416-2437; findings ride the existing
advisoriesmember, no member is added and nothing is refused; amended from the claim-time widest readingyes)Metadata-protocol: none
Responsibility:
n/a — not a defect cardThread-read: 7152193724
Premise: holds. Measured at a03c3d4:
validateAiContextis registered as anadvisoryrule withsurfaces: CLI_ONLY,surfaceReason: RUNTIME_NEEDS_FULL_SNAPSHOT(packages/lint/src/authoring-rules.ts:1966-1980), so onlyos validatereports it; its four verdicts are allwarning(validate-ai-context.ts:14-24). The runtime authoring gate runs other rules at save (packages/metadata-protocol/src/protocol-authoring-gate.ts; tests protocol.runtime-authoring-gate.test.ts, protocol.runtime-gate-stored-universe.test.ts), which is the precedent the card asks the PR to follow and state.Serial constraints cleared: #37173 (#37140) merged 03:39Z. This zone's open PRs (#37209 docs/adr, #37202 docs/adr, #37222 service-record-context) share no file. The overlap check runs at the first push.
Pre-claim lane:
domain:server(packages/lint,packages/metadata-protocol); a save-answer type edit, if any, stays here by the lane-keep rule and owes the L2 in L1-w.Pre-claim deps:
#37140merged (PR #37173)Prior rulings read: check-prior-rulings.mjs --card 37176 at a03c3d4: ai_context → 2 hits; ADR-0160 D1 ("reported at save and by
os validate"), ADR-0160 D8; thread: none; none conflictingDone when: a runtime-created pack with a misspelled field, an unknown related object, a related list with no link, or a non-long-text body reports the same rule id and message at save that
os validateprints, one pin per rule family; the PR states refused vs saved-with-warnings by the precedent; it lands before #37143 (row 7).objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK
os-dev-report
{ "issue": 37176, "status": "done", "branch": "claude/issue-37176-ai-context-save-time-errors", "pr": "https://github.com/objectstack-ai/objectstack/pull/37247", "session": "session_01WGufzi13yZRqVcp2mGonWK", "premise_still_valid": true, "summary": "validateAiContext now runs on the runtime publish door for ai_context: the registry row is CLI_AND_RUNTIME with runtimeTypes ['ai_context'] (authoring-rules.ts:1980), and TYPE_TO_STACK_KEY gains ai_context: 'aiContexts' (runtime-gate.ts:312). No metadata-protocol src change: the host already gathers live objects for every gated type. Precedent: saved with warnings, not refused. protocol-save.ts:1871 (gate errors thrown as the 422, advisories ride the 2xx) and :2416-2437 (conditional advisories key), as every advisory rule on the door does (validateRetiredPermissionResidue :2440, validateEmailTemplateDefaultArguments :3208). So Clause-2 is measured 'no' (the existing advisories member, no new member, nothing refused) and Metadata-protocol stays 'none'. One file-surface breach is declared, not hidden: the claim named authoring-rules.ts and validate-ai-context.ts, and the crossing also needs the one TYPE_TO_STACK_KEY row in packages/lint/src/runtime-gate.ts. A declared runtime type with no mapping builds no snapshot, and authoring-rule-wiring.test.ts refuses it. overlap-check was clean at every push. Remote branch head fa24633d (merge of origin/main onto 090e4c01).", "tests": "New pins: validate-ai-context.test.ts gets a top-level describe, 6 cases. Each of the 4 rule families (misspelled field, unknown related object, related list with no link, non-long-text body) gives no error, exactly one advisory with that rule and path, and rule/severity/where/path/message/hint equal to runAuthoringRules('validate') over the same pack; a clean pack earns nothing. protocol.runtime-authoring-gate.test.ts (the shared saveMetaItem harness) gets a top-level describe, 6 cases through the real saveMetaItem: each family is persisted with success:true and advisories equal to os validate's rule/where/message/hint, a clean pack has no advisories key, and a draft save is not judged. Package runs at 090e4c01: lint test 235/235 files, 9626/9626 tests, exit 0; lint typecheck exit 0; metadata-protocol test 370 passed + 9 skipped files, 23418 passed + 45 skipped tests, exit 0; metadata-protocol typecheck exit 0. The merge to fa24633d brought only packages/spec/src/ai/record-context-tools.zod.ts into these closures. Ablation at 090e4c01, through scripts/ablation-replace.mjs with an EXIT trap restore: runtimeTypes ['ai_context'] became ['ablated_ai_context'] (grep injected 1 / original 0), lint rebuilt, ablation-dist-preflight found the marker in 4 dist files. Lint describe 6 failed / 6 passed of 12; door describe 5 failed / 1 passed of 6 (the clean-pack case passes either way). Restore: blob == HEAD 239859dc, git diff HEAD empty, rebuilt, preflight --absent clean, then green 12/12 and 6/6.", "gates": "Local: dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at fa24633d derived 65 families; each was run with its exit code captured before any pipe. 61 exit 0. NOT MEASURED: check-plugin-teardown-shape --self-test (exit 3, shallow checkout cannot read its pinned fixture), check:dual-build-cjs-loads and check:lean-entry-closure (exit 3, need a whole-repo build), check:query-options-erasure (124, repo-wide ESLint scan hit the local 300s cap). --ran reconciliation: 65 derived, 65 run, 0 UNRUN. test:repo was not run locally (CI Test Core owns it). CI on PR head fa24633d: started, 23 check-runs at open (5 completed, 15 in_progress, 3 queued), mergeable_state blocked (draft and required checks, not dirty). Conclusions in_progress at report time.", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "0", "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls, draft, assignee os-support-ai; read-back 7087 bytes identical) = PR #37247; post-stamped os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/37176/comments). git push is not counted.", "open_questions": [ { "question": "Ratify the file-surface addition packages/lint/src/runtime-gate.ts (one TYPE_TO_STACK_KEY row, ai_context: 'aiContexts'), which the claim did not name?", "options": [ "A ratify: the row is the runtime-input seam the crossing cannot exist without (unmapped runtime type = no snapshot, refused by authoring-rule-wiring.test.ts); the claim's surface line is amended", "B refuse: the PR is withdrawn to a needs_decision on a different seam (none exists that keeps one rule list; running the rule outside AUTHORING_RULES would be a second runtime rule list, which runtime-gate.ts's header rules out)" ], "recommendation": "A, because the row is a one-line data edit in the table the claim's own crossing writes into, overlap-check was clean, and there is no alternative seam that keeps one rule registry." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted, not filed: on a write naming a package with readable dependencies, objects is narrowed to that package's closure, so a pack naming another package's object outside the closure is told ai-context-object-unknown in the words os validate uses for an object its stack does not hold (no ctx.packageScope wording in validateAiContext). In the PR's Acceptance notes; not a defect class (the CLI answers identically)." ] }objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK
os-dev-report
{ "issue": 37176, "status": "done", "branch": "claude/issue-37176-ai-context-save-time-errors", "pr": "https://github.com/objectstack-ai/objectstack/pull/37247", "session": "session_01WGufzi13yZRqVcp2mGonWK", "premise_still_valid": true, "summary": "Round 2 (L1 REWORK 7155741340, S1). validateAiContext now takes the write's package scope, as validateFlowTriggerReadiness does: run: (stack, ctx) => validateAiContext(stack, ctx.packageScope ? { packageScope: ctx.packageScope } : {}). Under a scope in force, ai-context-object-unknown is worded for the closure ('outside the closure of package \"P\" ..., so the pack reads nothing of it where the package is installed without that dependency'). Its hint is closureDependencyRemedy(name, packageId, 'name an object inside that closure'). Severity stays warning, and the unscoped os validate wording is unchanged. The authoring-rules.ts comment no longer says 'the snapshot cannot invent a finding'; it now states the closure narrowing and the remedy. A replacement PR body is ready for the coordinator to send: body file pr-body-r2.md and a one-action issue_patch file actions-r2.json, dry-run exit 0. New head 59f26fac (origin/main merged at 8c4ede01; fix 0a363d54; test rename 59f26fac). CI is all green on it and mergeable_state is clean. Test UI red on 0a363d54 was not this change: its 16 shards concluded 'cancelled' at 07:57:11 because the 59f26fac push superseded the run (ci.yml:115-117, concurrency group per PR number with cancel-in-progress: true). Test UI on 59f26fac is success, so no rerun was spent.", "tests": "New pins. validate-ai-context.test.ts: (a) under packageScope {app.policy, deps []}, an installed object owned by com.other is told the closure message (not 'this stack does not define') with the exact closureDependencyRemedy hint, and declaring the dependency clears it; (b) unscoped message and hint pinned verbatim. protocol.runtime-authoring-gate.test.ts, through the real saveMetaItem: a pack saved with packageId 'app.fx' (installed, no deps) naming 'account', owned by com.example.pages, is persisted with success:true, advisory ai-context-object-unknown at aiContexts[0].related[0].object, the closure message and the exact remedy. With no package, an unknown object keeps the os validate rule/where/message/hint. Package runs at 59f26fac: lint test 235/235 files and 9628/9628 tests, exit 0; lint typecheck exit 0; protocol.runtime-authoring-gate.test.ts 259 passed; metadata-protocol typecheck exit 0. The full metadata-protocol suite was last run at 090e4c01 (23418 passed); round 2 changed only the test file in that package. Scope ablation, with an EXIT trap restore: 'const closure = options.packageScope;' was replaced with a read of an unset global (marker __ablated_scope__, injected 1 / original 0), lint rebuilt, and dist-preflight found the marker in 4 files. Exactly the two scoped pins went red: lint 1 failed of 14, door 1 failed of 8. Restore: blob == HEAD 689cc794, rebuilt, preflight --absent clean, then 14/14 and 8/8. A first ablation attempt spelled its marker as an expression esbuild rewrites; dist-preflight could not see it, so that reading is void and not counted.", "gates": "Local at 59f26fac: dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 65 families; all 65 run, --ran reconciles 65 of 65, 0 UNRUN. 61 exit 0: check:type-check-debt hit the 300s cap in the batch and was rerun alone, exit 0, 0 raw tsc errors. NOT MEASURED: check-plugin-teardown-shape --self-test (exit 3, the shallow checkout cannot read its pinned fixture); check:dual-build-cjs-loads and check:lean-entry-closure (exit 3, they need a whole-repo build); check:query-options-erasure (124, the repo-wide ESLint scan hit the local cap). CI on PR head 59f26fac: 68 check-runs, 57 success, 11 skipped, 0 failed; Lint & Repo Gates, TypeScript Type Check, Test Core and Test UI are all success; mergeable_state clean.", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "0", "api_writes": "1 this round — post-stamped os-dev-report comment, POST /repos/objectstack-ai/objectstack/issues/37176/comments. The PR body issue_patch was prepared and dry-run only; the coordinator sends it. git push is not counted. Round 1 made 2 writes (pr_create #37247 and a report comment).", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [] }objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#3 · os-support-ai · session_01WGufzi13yZRqVcp2mGonWK
Close-out · 2026-11-25T09:44Z · PR #37247 merged 2026-11-25T09:43Z as 376377c, ahead of #37143; this card closed by
Fixes.pm:dispatchedremoved. A save ofai_contextmetadata now runsvalidateAiContextat the runtime authoring gate (same rule ids and messages asos validate; under a package, the closure remedy). Nothing else open on this card.