feat(hint): H2 Phase B — per-form keying + the three exemplars (ADR-0053)

The first exemplar (`add 1:n relationship`) showed per-node keying is
too coarse for multi-form commands, so revise the mechanism to per-form.

- CommandNode `hint_id: Option<&str>` -> `hint_ids: &[&str]` (mirrors
  usage_ids); hint_key_for_input_in_mode reuses a factored-out
  pick_form_key (shared digit/m:n/suffix form disambiguation with
  usage_key_for_input_in_mode)
- wire INSERT + ADD (all four forms) with hint_ids
- author the three approved exemplars: hint.cmd.insert,
  hint.cmd.add_relationship, hint.err.foreign_key.child_side
  (what/example/concept) + keys.rs registration
- revise ADR-0053 D3 to per-form; record clause-concept hints as a
  deferred extension (issue #37); update README + plan
- +5 tests; 2488 pass / 1 ignored, clippy clean
This commit is contained in:
claude@clouddev1
2026-06-15 12:18:41 +00:00
parent 050b36391e
commit 4a5fd1b5c1
11 changed files with 292 additions and 109 deletions
+14 -14
View File
@@ -266,7 +266,7 @@ pub static QUIT: CommandNode = CommandNode {
shape: EMPTY_SEQ,
ast_builder: build_quit,
help_id: Some("app.quit"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.quit"],};
pub static HELP: CommandNode = CommandNode {
@@ -274,7 +274,7 @@ pub static HELP: CommandNode = CommandNode {
shape: HELP_TOPIC_OPT,
ast_builder: build_help,
help_id: Some("app.help"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.help"],};
pub static HINT: CommandNode = CommandNode {
@@ -283,7 +283,7 @@ pub static HINT: CommandNode = CommandNode {
ast_builder: build_hint,
help_id: Some("app.hint"),
// hint_id assigned in Phase C with the tier-3 corpus (ADR-0053).
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.hint"],};
pub static REBUILD: CommandNode = CommandNode {
@@ -291,7 +291,7 @@ pub static REBUILD: CommandNode = CommandNode {
shape: EMPTY_SEQ,
ast_builder: build_rebuild,
help_id: Some("app.rebuild"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.rebuild"],};
pub static SAVE: CommandNode = CommandNode {
@@ -299,7 +299,7 @@ pub static SAVE: CommandNode = CommandNode {
shape: SAVE_AS_OPT,
ast_builder: build_save,
help_id: Some("app.save"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.save"],};
pub static NEW: CommandNode = CommandNode {
@@ -307,7 +307,7 @@ pub static NEW: CommandNode = CommandNode {
shape: EMPTY_SEQ,
ast_builder: build_new,
help_id: Some("app.new"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.new"],};
pub static LOAD: CommandNode = CommandNode {
@@ -315,7 +315,7 @@ pub static LOAD: CommandNode = CommandNode {
shape: EMPTY_SEQ,
ast_builder: build_load,
help_id: Some("app.load"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.load"],};
pub static EXPORT: CommandNode = CommandNode {
@@ -323,7 +323,7 @@ pub static EXPORT: CommandNode = CommandNode {
shape: EXPORT_PATH_OPT,
ast_builder: build_export,
help_id: Some("app.export"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.export"],};
pub static IMPORT: CommandNode = CommandNode {
@@ -331,7 +331,7 @@ pub static IMPORT: CommandNode = CommandNode {
shape: IMPORT_BODY_OPT,
ast_builder: build_import,
help_id: Some("app.import"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.import"],};
pub static MODE: CommandNode = CommandNode {
@@ -339,7 +339,7 @@ pub static MODE: CommandNode = CommandNode {
shape: MODE_VALUE,
ast_builder: build_mode,
help_id: Some("app.mode"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.mode"],};
pub static MESSAGES: CommandNode = CommandNode {
@@ -347,7 +347,7 @@ pub static MESSAGES: CommandNode = CommandNode {
shape: MESSAGES_VALUE_OPT,
ast_builder: build_messages,
help_id: Some("app.messages"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.messages"],};
pub static UNDO: CommandNode = CommandNode {
@@ -355,7 +355,7 @@ pub static UNDO: CommandNode = CommandNode {
shape: EMPTY_SEQ,
ast_builder: build_undo,
help_id: Some("app.undo"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.undo"],};
pub static REDO: CommandNode = CommandNode {
@@ -363,7 +363,7 @@ pub static REDO: CommandNode = CommandNode {
shape: EMPTY_SEQ,
ast_builder: build_redo,
help_id: Some("app.redo"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.redo"],};
pub static COPY: CommandNode = CommandNode {
@@ -371,5 +371,5 @@ pub static COPY: CommandNode = CommandNode {
shape: COPY_VALUE_OPT,
ast_builder: build_copy,
help_id: Some("app.copy"),
hint_id: None,
hint_ids: &[],
usage_ids: &["parse.usage.copy"],};