Repository navigation
docs(tasks): autonomous-dev brief names the lookup factory, not the retired reference_to key - #1817
Merged
zhuangjianguo merged 1 commit intoSep 9, 2026
Conversation
…etired `reference_to` key The copy-paste brief that puts an agent in the Autonomous Development role closed with a self-correction bullet telling it to check that "all foreign keys (`reference_to`) point to valid objects". `FieldSchema` has no `reference_to` key; before that shape was closed the key was dropped silently, so an author following the bullet got a field created minus the constraint they wrote. This was the fourth and last teaching site in the repo. The other three (`AGENTS.md` `:62`, `:141`, `:348` and `.github/instructions/metadata.md`) were corrected by PR #1809, which recorded this one as outside its file surface. The replacement mirrors what landed rather than coining a third phrasing: "lookup / master-detail targets" and "name real objects" are AGENTS.md's Phase-3 checklist entry verbatim, and the `Field.lookup(...)` / `Field.masterDetail(...)` parenthetical is the spelling AGENTS.md uses at `:62` and `:348`. The brief's own "defined in Phase 2" anchor is kept. The bullet is the only line that moves. Measured at this commit, zeros paired with controls: `reference_to` has 0 matches under `.github/` (control `Field.lookup` returns 2 there) and 0 teaching sites repo-wide. The 10 remaining matches are non-teaching and untouched: 3 in PR #1809's changeset, 2 under `docs/archive/2026-02/`, and 5 lines across 4 `test/*.ts` files reading the key as a tolerant alias. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017FzrA1G4U89KEMf7wfLmqq
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1812
.github/tasks/autonomous_feature_dev.md— the copy-paste brief that puts an agent in the Autonomous Development role — closed with this self-correction bullet:FieldSchemahas noreference_tokey. Before that shape was closed the key was dropped silently: the field was still created, minus whatever the author wrote it to constrain, protect or compute. This was the fourth and last site in the repo that taught the retired key to an agent — PR #1809 corrected the other three (AGENTS.md:62,:141,:348and.github/instructions/metadata.md) and recorded this one as outside its declared file surface.It is also the worst place for it to have survived: this file is handed to an agent as a whole prompt, and the role file it loads (
.github/instructions/architect.md) names no field factory at all — so the brief was the agent's only word on how to spell a relationship.The change — one line
Plus a changeset with empty frontmatter (agent-facing docs; nothing ships to users).
Wording provenance — mirrored, not a third phrasing
Three files stating one rule three ways is how this class recurs, so every fragment below is lifted from what PR #1809 actually landed:
lookup / master-detail targets…name real objectsAGENTS.md:141— "Do all lookup / master-detail targets name real objects?"(`Field.lookup(...)` / `Field.masterDetail(...)`)AGENTS.md:62and:348, verbatim including the punctuationEnsure all …/defined in Phase 2The factory parenthetical is the one addition beyond the bare
:141checklist text. It is declared rather than folded in silently: batch #74 ruled stop teaching a raw key, name the factory, and in this file there is nowhere else for an agent to learn the factory from (architect.mdis a file-mapping brief; it is the siblingnew-feature.md— not this one — that points at.github/instructions/metadata.md).Measurement — every zero paired with a control
Repo-wide, at this commit. The five tolerant-alias reads under
test/**still match, so a naive zero would have been impossible and a naive non-zero proves nothing; each count below therefore names exactly what was counted.reference_toteaching sites, repo-widereference_tolines under.github/(whole tree, not just the file)Field.lookuplines under.github/— proves the pathspec is livereference_tolines repo-wide, all kindsThe 10 survivors are all non-teaching and deliberately untouched:
.changeset/metadata-brief-teaches-the-lookup-factory.md— PR docs: stop teaching the retiredreference_tokey and an object shape the repo never uses #1809's own release-notes record. Two quote the engine's error; one records this very site as unfixed there. Editing another PR's changeset would rewrite its history, so this PR's changeset closes the loop instead. Both ship in the same release.docs/archive/2026-02/CRM_INDUSTRY_AI_TRANSFORMATION_REPORT.md— an archived February direction underdocs/archive/.test/**— epic Epic: bring this repo's test farm back under the 2026-08-31 ruling — platform-first,os lint --strictfirst, then retire the local re-implementations by family #1579's fenced territory, untouched by instruction.test/*.tsfiles.git grep -lreturns four —lead-duplicate-management.test.ts(2 lines),sharing-coverage.test.ts,view-references.test.ts, andopportunity-line-item-add-picker.test.ts(the now-false comment at:91, not an alias read). Five is the line count, four is the file count. Nothing intest/**was touched either way.Acceptance notes — found while measuring, NOT fixed here
The dispatch asked for the whole
.github/tasks/directory to be measured, not just the one line.reference_toappears there exactly once (now zero). The sweep did surface two same-shaped defects of different classes, both left alone and filed instead:.github/instructions/automation.md§1 and.github/tasks/autonomous_feature_dev.md:17still teach a*.workflow.tsmetadata type no installed package defines — #852's class, two surviving sites #1818 —.github/tasks/autonomous_feature_dev.md:17teachesAutomation (.workflow.ts), and.github/instructions/automation.md§1 is a whole section titled Workflow Rules (.workflow.ts).AGENTS.mdstates there is noworkflowmetadata type (ADR-0019/0020). Measured here:WorkflowRuleSchemahas 0 occurrences undernode_modules/@objectstack/(control:FlowSchemais present in@objectstack/spec/dist),src/**has 0*.workflow.tsfiles and 22*.flow.tsfiles. Line 17 sits inside this card's file surface, but it is a different defect fromreference_to, and the ruled class here is a key, not a file suffix — so it takes the default route: filed, not folded in. AGENTS.md 第 120 行让 agent 用WorkflowRuleSchema.parse()校验「Workflows」—— 该导出在平台上不存在 #852 retired the same shape fromAGENTS.md; these are surviving sites of that class..github/tasks/new-package.mdstill prescribes the retiredpackages/scaffold — #1518's class, the site that card did not reach #1819 —.github/tasks/new-package.mdteachespackages/[PACKAGE_NAME]/…scaffolding, a directionAGENTS.mdretires by name ("The retired multi-package (packages/*) direction is archived underdocs/archive/"), and which.github/workflows/code-quality.ymlalready calls "a directory this repo does not have". Outside this card's file surface. .github/instructions/architect.md prescribes apackages/layout hotcrm does not have — in its standing rules and its mandatory Output Format, not only in its worked example #1518 retired the same shape from.github/instructions/architect.md; this is a surviving site of that class.Both were dedup-searched before filing; the only prior cards are closed (#852, #1518, #1686). Neither is assigned or labelled — they are the PM's to triage.
Deliberately not filed, and not touched: the
test/**items above (known, inert, fenced), and theFEATUEtypo at line 7 of the same brief (style).Gates
pnpm verifyat9b6ac5f— exit 0, 187s wall. The code was captured before any pipe (pnpm verify > log 2>&1; EXIT=$?), so it is the chain's own status and not a reader's.All eight links ran. Verdict lines as each gate printed them:
validate✓ Validation passed (1552ms)—Data: 18 Objects 331 Fieldstypechecktsc --noEmit— no diagnosticslint1 warning(s), 12 suggestion(s)lint:i18n-gate✓ i18n lint gate: 0 i18n/missing-* issueshygiene✓ source hygiene cleanhygiene:tokens✓ source token ratchet cleanbuild✓ Build complete (1940ms)—Data: 18 Objects 331 FieldstestTest Files 165 passed (165)· `Tests 3453 passedThe single lint warning is pre-existing and untouched —
page "sales_home_page" · page:card: description is not a prop— and this diff contains nosrc/file, so it cannot have moved.Line budget. This diff is
+46 / -1across 2 files, measured against the branch point7ddc88brather thanorigin/main(which advanced to5c329c6under this branch mid-run). The authored-surface token ratchet readsauthored total ~137,092 tokens (ceiling ~140,000)— byte-identical to the parent commit, because nothing undersrc/moves.Landing posture
⛔ Draft, and it stays one. ⛔ Not marked ready. ⛔ Auto-merge not armed.
By the letter of
AGENTS.md§How a green PR lands, the governed set isAGENTS.md,CLAUDE.md,.claude/**,.github/instructions/**—.github/tasks/**is not in it, so this PR is non-governed and a seat could land it. But it is an agent-instruction surface of exactly the same kind, and the seat has raised that gap with the maintainer rather than deciding it. The flip is the seat's to make; nothing here depends on it happening fast.维护者速读(草稿)
改了什么 — 只改一句话。
.github/tasks/autonomous_feature_dev.md是发给 AI 的「自主开发」整段提示词,它最后的自检清单要求 AI 检查reference_to这个键。该键在平台上不存在,本 PR 把它换成平台真正的写法:Field.lookup(...)/Field.masterDetail(...),用词直接抄 PR #1809 已落地的AGENTS.md原文。另加一个空 frontmatter 的 changeset(面向 AI 的文档,不对外发版)。为什么改 — 这是全仓最后一处还在教 AI 用这个废弃键的地方。危害不是拼写难看:在平台收紧校验之前,写了这个键的字段会被静默创建但丢掉约束 —— 字段在,权限/关联/校验没了,而且没有任何报错。#1686 已修掉另外三处,唯独这份提示词在它的文件范围之外。更麻烦的是,这份提示词加载的角色文件里根本没提字段工厂,所以它是 AI 关于「关联字段怎么写」的唯一信息来源。
风险与代价(含回滚) — 风险接近零:不涉及
src/任何元数据,不发版,不改测试。回滚就是 revert 这一个 commit。真正的代价在别处:本次顺带量出两处同类问题(.workflow.ts这个不存在的元数据类型、new-package.md教的packages/目录结构),按规矩没有夹带修复,已另立卡片,详见上面的 Acceptance notes。席位意见 —
你要做的 — 一件事:
.github/tasks/**要不要纳入受管路径(governed set)?它和.github/instructions/**是同一类东西 —— 都是发给 AI 的行为指令,写错就是让 AI 系统性地写错元数据 —— 但 PR #1798 定的受管清单里没有它。您说纳入,以后这类 PR 就由您合并;您说不纳入,席位按普通 PR 处理。在您回话之前,本 PR 保持 draft 不动。Generated by Claude Code