Repository navigation
Rewrite title_template guidance to state the assemble-vs-single-field premise - #2821
Merged
Merged
Conversation
… premise
TITLE_TEMPLATE_PLACEHOLDERS' original wording ("identity comes from its
fields rather than free-form content") never established the premise that
content already holds a node's name for entity types, so it read as a
structured-data-vs-prose contrast instead of the real one: one field vs.
several. That caused two real failures in one session: title_template set
on a single-field identity (plus a redundant duplicate field), and a
composed identity hand-assembled into content instead of templated.
Rewrote both imperative and prose forms in skill_rules.rs to state the
premise (content is the name for entity types; only markdown primitives
like text/header use it as prose), the rule (title_template assembles a
title from two or more fields; a single-field identity's value goes
directly in content, never duplicated into a separate field), and the
three-way distinction from the tracking issue's table (single-field
identity, composed identity, markdown primitive). Regenerated
packages/skill/references/cli.md via skill:gen and updated the
stage2_candidate_block golden that pinned the old wording.
Added schema_creation_guidance_covers_title_template_discrimination,
mirroring the existing per-rule coverage tests in skill_pipeline.rs, to
pin that the seeded guidance actually carries the premise and the
single-field no-duplicate-field rule going forward.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
…se the primitive list pragmatic-code-review on PR #2821 verified two precision gaps against the real title-computation path (NodeService::compute_title, packages/core/src/services/node_service/crud.rs): - "NodeSpace surfaces it as the title automatically" was stated unconditionally, but a nested (non-task/collection) node with no parent gets no computed title at all regardless of content — scoped the claim to "a node created without a parent" in both rule forms. - The "(text, header, quote-block, code-block)" example list read as exhaustive under "Only markdown primitives ... use content as a prose body", but several other built-ins (ordered-list, checkbox, horizontal-line, table) share the same content-is-not-identity behavior. Added "etc." to both forms so the list reads as illustrative, matching the prose form's existing "Markdown primitive — text, header, etc." bullet, which already hedged this way. Also added a third assertion to schema_creation_guidance_covers_title_ template_discrimination pinning that the guidance names "markdown primitives" as the content-is-prose exception, closing a coverage gap the review flagged in the same pass. Regenerated cli.md and the stage2_candidate_block golden for the wording change. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
Author
Review response (pragmatic-code-review, medium effort)The review traced the actual title-computation path (
All addressed in commit c469619. Regenerated Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: All three findings were narrow, surgical text/test edits (scoping one claim, adding "etc." to a list, adding one assertion) — no logic changes, no new code paths, no architectural decisions. The changes are low-risk and straightforward to verify by reading the diff directly. |
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.
Summary
TITLE_TEMPLATE_PLACEHOLDERSinpackages/agent/src/skill_rules.rsnever stated the actual premise behindtitle_template: thatcontentis almost always a node's name/identity for entity types (only markdown primitives liketext/headerusecontentas a prose body). Without that premise, "identity comes from its fields rather than free-form content" reads as a contrast between structured data and a prose blob — so any entity with fields at all looks like it needs a template, instead of the real contrast: one field vs. several.This caused two real failures in one session (per the tracking issue): a single-field identity (
Customer) got a pointlesstitle_templateplus a redundant duplicate field, and a genuinely composed identity (Person) got hand-assembled intocontentinstead of templated.Changes
imperativeandproseforms ofTITLE_TEMPLATE_PLACEHOLDERSinpackages/agent/src/skill_rules.rsto state the premise (contentis the node's name for entity types) and the correct rule (title_templateassembles a title from two or more fields; a single-field identity's value goes directly incontent, never duplicated into a separate field), including the single-field-identity / composed-identity / markdown-primitive distinction from the issue's own table.packages/skill/references/cli.mdviabun run skill:gen.packages/agent/tests/golden/prompt_assembly/stage2_candidate_block.golden, which pinned the old wording, viaUPDATE_GOLDEN=1 cargo test -p nodespace-agent --test prompt_assembly_snapshot.schema_creation_guidance_covers_title_template_discriminationinpackages/agent/src/skill_pipeline.rs, mirroring the existing per-rule coverage tests (schema_creation_guidance_covers_unique_field_flags,..._covers_add_field_values), to pin that the seeded Schema Creation guidance actually carries the premise and the single-field no-duplicate-field rule going forward.Scope note
The issue also raised a related but separate concern —
NO_NAME_TITLE_FIELD's:371naming-collision framing vs. a semantic duplicate-value rule, and theone-schema-per-requestparagraph split. The latter is tracked separately as #2812; theNO_NAME_TITLE_FIELDfollow-up was left untouched as out of scope for this fix, which targets only thetitle_templatepremise/rule itself.Closes #2790
Test plan
cargo test -p nodespace-agent --lib skill_pipeline::— 33 passed, including the new regression testcargo test -p nodespace-agent --lib skill_rules::— 6 passedcargo test -p nodespace-agent --test prompt_assembly_snapshot— 5 passed (golden updated)cargo test -p nodespace-cli --test skill_md_generation— 11 passed, includingchecked_in_skill_md_is_up_to_datebun run test— 5240 tests, 0 failures attributable to this change (one pre-existing flaky timing test in an unrelated multi-tab-reactivity integration test, confirmed to pass in isolation and untouched by this diff)bun run quality:fix— cleantest:all+cargo build --bin nodespaced+test:e2e) — all green🤖 Generated with Claude Code