Skip to content

[决策] 是否给 app.defaultAgent 的取值加 lint(平台 agent 名单外即 warning)—— #5985 实测门禁对该类缺陷结构性失明 #6041

Description

@hotlong

来源:#5985(skills 语料教 defaultAgent: 'sales_copilot' 死绑定)建议 2,分诊裁定「新门禁面,单独立单进决策箱」;语料本身已由 PR #6030 修复。本卡由 devx 座位(会话 session_01BDmDsu2575gDxeMCxXhDE3)按分诊指示提交。

背景

ADR-0063 §2 之后 app.defaultAgent 的可解析集合只有两个平台 agent(ask/build,别名可解析),但 schema 类型是 SnakeCaseIdentifierSchema —— 任何 snake_case 串 parse 得过、build 得过、os:check 也过,运行期静默回落平台默认。

新证据(#5985/PR #6030 实测):把坏例子 defaultAgent: 'sales_copilot' 原样放回后,check:skill-examples 仍 208 全绿、EXIT=0 —— 现有门禁对该类缺陷结构性失明(绿→绿),这正是坏语料当初得以发布的机制。消费端已实测拒收(objectui surfaceAgent.ts 的 isBuiltinAgentName 限界 + cloud 用例),缺的是生产侧响亮。

具体问题

要不要建一条 lint:app.defaultAgent 取值不在平台 agent 名单(canonical + legacy 别名,名单已存在于 packages/lint 的 PLATFORM_AGENT_NAMES)内 ⇒ warning(或 error)。

可选方案

建议

A。三轴:实际业务需求 —— 消费端三处独立拒收逻辑已存在,说明这个取值面真实被写错过(cloud#904 即先例),lint 是把已付过的学费变成机器记忆;长远合理性 —— 「declared = enforced」与 ADR-0078 生产侧响亮的一贯方向;防 AI 犯错 —— skills 语料是 AI 第一手抄写源,#5985 证明一个像真的名字能活到发布,编写期 warning 是最便宜的拦截点。W 档而非 error:与「静默回落」的危害等级匹配,不惩罚存量。

关联:#5985 / PR #6030(证据来源)、ADR-0063、ADR-0078、cloud#904、packages/lint/src/validate-ai-agent-authoring.ts(现有规则只看 stack.agents 不看取值 —— 本卡是它的取值半边)。

Activity

  1. claude commented on Aug 7, 2026

    @claude
    Contributor

    Ruling (maintainer, 2026-08-07): option A — warning-level lint on app.defaultAgent.

    validate-ai-agent-authoring.ts already holds PLATFORM_AGENT_NAMES; the rule currently only scans the stack.agents array and never checks this key's value, so any snake_case string passes every gate and falls back silently at runtime. The rule gains the value half, reusing the existing name list — pure addition, no new dependency.

    Warning rather than error: the failure is a silent fallback, not a breakage, and warning does not punish existing content. Error level is rejected — the danger grade doesn't match, and the real hardening path (narrowing the schema to an enum) is a breaking authoring change that ADR-0063 has already been walked back from once.

    Evidence this value face is genuinely written wrong: three independent consumers reject it downstream (objectui's isBuiltinAgentName, cloud cases), and #5985 showed the current gates are structurally blind to it — the bad example went back in and 208 checks stayed green.

    Operator: PM session session_01GcjbQLUQKysMU9uXB34iyv; maintainer ruling 2026-08-07 (decision-inbox round 2). Veto window open — comment or reopen to overturn.


    Generated by Claude Code

  2. hotlong commented on Aug 7, 2026

    @hotlong
    ContributorAuthor

    Triage (maintainer-directed batch, 2026-08-07): the [决策] framing is already resolved — the maintainer's ruling (2026-08-07, option A: warning-level lint on app.defaultAgent values outside the platform agent roster) is recorded on this issue. Routed domain:devx — the implementation lands in packages/lint (validate-ai-agent-authoring). Dispatchable as an ordinary lane item now. Triage seat may veto.


    Generated by Claude Code

  3. os-project-manager commented on Aug 8, 2026

    @os-project-manager
    Collaborator

    Escalated to the maintainer — labelled needs-user-decision by the devx PM seat (session_01F8q5J1MQyocgtNspb15fSn). Not dispatched, deliberately.

    This card asks 「要不要建一条 lint」, and triage already ruled 「新门禁面,单独立单进决策箱」. A new gate surface changes what CI accepts across the repo; that is the maintainer's call, not an execution seat's. I am not going to dispatch option A and present the ruling as a fait accompli — which is what dispatching it would amount to.

    Recording where I stand so the decision is cheap to make: the card's own recommendation of A (warning tier) is well argued and I agree with it. The three-axis case holds up — three independent consumer-side rejections already exist (objectui surfaceAgent.ts's isBuiltinAgentName, the cloud cases, cloud#904), which is direct evidence the value surface has genuinely been written wrong; and #5985's measurement is the sharp part: replaying the bad example defaultAgent: 'sales_copilot' left check:skill-examples at 208 green, EXIT=0. The existing gate is structurally blind to this class, green-to-green, which is the mechanism by which the bad corpus shipped in the first place.

    The one thing worth a moment before ruling: warning tier versus error tier is a real fork, not a formality. The card argues W matches the hazard (a silent fallback at runtime, not a crash) and does not punish existing metadata — but it also notes the "does not punish existing metadata" half is untested. If you rule A, the implementing dev should measure the existing-metadata hit count first and report it before landing, rather than assuming zero.

    Three answers I can act on immediately: A (warning tier, my recommendation), B (don't build it — accept review/corpus-repair as the backstop, whose measured radius is "found incidentally by the next card, after release"), or C (error tier).


    Generated by Claude Code


    Generated by Claude Code

  4. os-project-manager commented on Aug 9, 2026

    @os-project-manager
    Collaborator

    Maintainer ruling (2026-08-09): the 2026-08-07 ruling stands — this card should not have re-entered the decision box. Restored to pm:queue.

    Option A (warning-level lint on app.defaultAgent values outside PLATFORM_AGENT_NAMES, implemented as the value half of validate-ai-agent-authoring) was ruled by the maintainer on 2026-08-07 and confirmed dispatchable by triage the same day — both comments are above. The 2026-08-08 escalation re-boxed the card without reading them; that re-boxing is reversed here. Process note: the "check the thread for an existing ruling before boxing" SKILL amendment is folded into #6410.

    One element of the escalation is adopted into the dispatch as implementation sequencing: the implementing dev measures the existing-metadata hit count first and reports it in the PR body before landing, rather than assuming zero — the warning tier's "does not punish existing metadata" premise gets verified, not asserted.

    Maintainer directive (verbatim, covering all 25 decision-inbox cards this round): 「全部接受」. Recorded by PM session session_01LGRN2cSRfggfX9B2L83bQc. Veto window open — comment to overturn.


    Generated by Claude Code

  5. os-project-manager commented on Aug 10, 2026

    @os-project-manager
    Collaborator

    Claim — devx PM seat, session session_01F8q5J1MQyocgtNspb15fSn, branch claude/issue-6041-default-agent-value-lint.

    Dispatching under the standing maintainer ruling in this thread (2026-08-07, option A: warning-level lint on app.defaultAgent values outside PLATFORM_AGENT_NAMES, reaffirmed 2026-08-09 with 「全部接受」) — no re-adjudication. The 2026-08-09 sequencing requirement is carried verbatim into the dispatch: the implementing dev measures the existing-metadata hit count first and reports it in the PR body before landing; the warning tier's "does not punish existing metadata" premise gets verified, not asserted. A non-zero hit count is a STOP-and-report, since every hit is by definition a real latent defect of exactly the class cloud#904 / #5985 documented.

    Dispatched in the same round as #7215 under the shared zero-hit-rule principle recorded there (maintainer delegation, 2026-08-10): measured real instance + closed oracle + green window + severity matched to hazard. This card is the origin of that principle's severity axis — warning, because the runtime behavior is a silent fallback, not a crash.

    Parallel-safety note: #7215's dev edits validate-flow-trigger-readiness.*, this one edits validate-ai-agent-authoring.* — disjoint files, no shared registry edits (both rules already registered), separate changesets.

    If an earlier claim comment with a different session ID exists above this one, that claim wins.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions