Skip to content

code_annotate

code_annotate attaches a note directly to a named function in the graph. Annotations appear in future code_signature calls and in any context view of that function. They are institutional memory without polluting source code.

code_annotate(name="processPayment", note="Always call with a valid idempotency key. See ADR-012.")
code_annotate(name="db.migrate", note="DANGER: irreversible. Must be reviewed by a senior engineer.")
code_annotate(name="processPayment", delete=true)
ParameterTypeDefaultDescription
namestringrequiredFunction or symbol name
notestringAnnotation text to attach; omit to read existing annotation
deletebooleanfalseRemove the annotation instead of adding one
processPayment
[annotation] Always call with a valid idempotency key. See ADR-012.
  • Mark a function with a warning that every future reader should see
  • Link a function to a decision record or incident post-mortem
  • Note a known gotcha that is not safe to put in a code comment
  • Document invariants that are not obvious from the implementation
code_annotatecode_knowledge
ScopeOne specific functionBroad subject, linked to multiple symbols
Appears incode_signature callscode_related, code_context, code_impact
Best forWarnings, invariantsArchitecture notes, patterns, decisions