oschema skill prescribes manually declaring sid/created_at/updated_at — generator already auto-injects them #275
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills#275
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
skills/oschema/oschema.md(the authoritative source of theoschemaskill loaded by Claude) instructs authors that every root object MUST declare asid: strfield, and every example also declarescreated_at: otime/updated_at: otimeby hand. Excerpts:Why this is wrong
The Rust struct generator in
hero_rpc(crates/generator/src/rust/rust_struct.rs) auto-injectssid: SmartId,created_at: u64, andupdated_at: u64on every root object, and silently skips any schema-declared duplicates:The parser detects root-object-ness from either a
sidfield or a[rootobject]comment marker (crates/oschema/src/parser.rs:655-661), so[rootobject]alone is sufficient —sid: strwas never required.The net effect of the current skill:
sid: strline in the schema is misleading — the generated field ispub sid: SmartId(notString).created_at: otimeline in the schema is misleading — the generated field ispub created_at: u64(notOTime).hero_service/schemas/catalog/catalog.oschemaand propagated.What to change in the skill
[rootobject]in the leading comment. Do not declaresid,created_at, orupdated_at— they are auto-injected by the generator and managed by the server.skills/oschema/oschema.md(Project / Task / Product / etc.) to drop the explicitsid/created_at/updated_atlines.sid: SmartId,created_at: u64,updated_at: u64— so anything written in the schema for these names is ignored anyway.Acceptance
skills/oschema/oschema.mdno longer says root objects "MUST have asid: strfield."[rootobject]and omitssid/created_at/updated_at.~/.claude/skills/oschema/SKILL.mdpicks up the change after the next mother-skill sync.Refs
hero_servicecatalog schema redeclares both these auto-fields and types that live inherolib_core::base).hero_rpc/crates/generator/src/rust/rust_struct.rs.hero_rpc/crates/oschema/src/parser.rs.ServiceDefinitionto name + description + interfaces #1herolib_core::baseServiceToml types per-service #72ServiceDefinitionto name + description + interfaces #1sidfield, contradicting Rust struct emitter (which auto-injects it) #85sid-field requirement on root objects (#85) #88Worked on branch
issue-275-oschema-skill-sid(commit8118f85).Edits to
skills/oschema/oschema.mdsid: str. Replaced with an explicit auto-injection callout: the generator injectssid: SmartId,created_at: u64,updated_at: u64; authors MUST NOT declare them.sid: str/created_at: otime/updated_at: otime:Task(Root Objects intro)Product(Field Decorators)Project+Task(Complete Example with Root Objects)User+Task(Using SID in Schemas) — also reframed as[rootobject]declarations with a typedsidreference field instead of demoing manualsid: str.User(Name Fields Consistently) — renamedcreated_attosignup_dateto avoid copy-paste confusion.project_sid: strtoproject_sid: sidso the typed reference is the path of least resistance.Verification
grep 'sid: str' skills/oschema/oschema.md→ 0 hits.grep 'created_at\|updated_at' skills/oschema/oschema.md→ only the new auto-injection callout at line 347.Ready for review.
Resolved in PR #278 (squash-merged into
development).[rootobject]is sufficient; sid/created_at/updated_at are auto-injected by the generator and MUST NOT be declared.sid: SmartId,created_at: u64,updated_at: u64).project_sid: strto typedproject_sid: sid.Verification (
grep 'sid: str') → 0 hits in example blocks.