원클릭으로
hgraf-add-span-kind
Add a new SpanKind enum value — proto, converters, renderer color, status semantics, kind_string fallback, and tests.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Add a new SpanKind enum value — proto, converters, renderer color, status semantics, kind_string fallback, and tests.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Understand and safely change heartbeat interval, stuck threshold, and timeout constants — client cadence, server detection math, frontend signal.
Add a new AnnotationKind — proto, storage, ingress RPC, optional downstream delivery to agents, frontend authoring UI, tests.
Add a new agent Capability — proto enum, client advertisement, server ingest, frontend gating in the control UI.
Add a new ControlKind — capability advertisement, client handler, server routing, ack semantics, frontend button, and tests — all the way through.
Add a new drift kind end-to-end. Goldfive owns the detector + enum; harmonograf reflects the kind through the intervention aggregator and the UI timeline.
Script a complex multi-turn FakeLlm scenario — function calls, tool chains, drift events, side-effect hooks, partial responses — for deterministic adk test coverage.
| name | hgraf-add-span-kind |
| description | Add a new SpanKind enum value — proto, converters, renderer color, status semantics, kind_string fallback, and tests. |
A framework you want to support emits an activity category that doesn't map onto the existing nine kinds (INVOCATION, LLM_CALL, TOOL_CALL, USER_MESSAGE, AGENT_MESSAGE, TRANSFER, WAIT_FOR_HUMAN, PLANNED, CUSTOM). Prefer SPAN_KIND_CUSTOM with a kind_string label for framework-local labels — reach for a new enum value only when multiple frameworks emit the same semantic concept.
proto/harmonograf/v1/types.proto:91-102 — the SpanKind enum and the comment establishing the CUSTOM + kind_string escape hatch.SPAN_KIND_CUSTOM with kind_string = "framework_label" instead.frontend/src/gantt/colors.ts:24 KIND_TO_VAR, pulling the actual hue from a CSS custom property set by frontend/src/theme/themes.ts.proto/harmonograf/v1/types.proto:91:
enum SpanKind {
SPAN_KIND_UNSPECIFIED = 0;
// ...
SPAN_KIND_CUSTOM = 9;
SPAN_KIND_MEMORY_OP = 10;
}
make proto
server/harmonograf_server/convert.py and storage/base.py carry a SpanKind Enum mirroring the proto. Grep for the string SpanKind.TOOL_CALL to find every Python enum definition and add MEMORY_OP everywhere it appears. Typical locations:
server/harmonograf_server/storage/base.py — the Python enum used by the Store.server/harmonograf_server/convert.py — _KIND_TO_STORAGE / _STORAGE_TO_KIND bidirectional maps.server/harmonograf_server/ingest.py — the _TASK_BINDING_SPAN_KINDS frozenset (ingest.py:56) — decide if your new kind should bind to task state like LLM_CALL / TOOL_CALL do, or be observability-only.On the client, client/harmonograf_client/enums.py holds the same Enum. Add the value there.
frontend/src/gantt/types.ts:4 SpanKind is a TypeScript string-literal union; add | 'MEMORY_OP'.
frontend/src/rpc/convert.ts:44 SPAN_KIND:
const SPAN_KIND: Record<PbSpanKind, UiSpanKind> = {
// ...existing entries...
[PbSpanKind.MEMORY_OP]: 'MEMORY_OP',
};
frontend/src/gantt/colors.ts:24 KIND_TO_VAR:
const KIND_TO_VAR: Record<SpanKind, string> = {
// ...existing...
MEMORY_OP: '--hg-kind-memory-op',
};
Add the CSS variable in frontend/src/theme/themes.ts for every theme (light + dark). Grep for --hg-kind-llm-call as a template. If you forget, cssVar (colors.ts:52) returns #888888 as the fallback and you'll see grey spans everywhere — which is a useful smoke test for missing theme entries.
frontend/src/components/Gantt/GanttLegend.tsx has a static array describing each kind for the UI legend. Add an entry.
kind_string fallback sanity checkIf an agent emits the new kind but runs against an older frontend, the pb3 unknown enum rules mean the frontend sees UNSPECIFIED unless the TS stubs are regenerated. That's fine for internal deployments where you regen atomically. For external consumers, also emit a kind_string set to "memory_op" so downstream tooling has a human label. Document this in the proto comment.
server/tests/test_storage_extensive.py — round-trip a span of the new kind through memory + sqlite stores.server/tests/test_telemetry_ingest.py — ingest pipeline accepts the new kind and stores it.frontend/src/__tests__/rpc/convert.test.ts — conversion maps PbSpanKind.MEMORY_OP to 'MEMORY_OP'.frontend/src/__tests__/gantt/renderer.test.ts — renderer applies the right color variable.make proto
uv run pytest client/tests server/tests -x -q -k span
cd frontend && pnpm test -- --run
cd frontend && pnpm typecheck
storage/base.py, the client enum in enums.py, the TS literal union in gantt/types.ts, and the converter in rpc/convert.ts are four separate sources of truth. Missing any one will compile-fail or silently mis-convert.--hg-kind-*. The renderer won't warn._TASK_BINDING_SPAN_KINDS in ingest.py:56 determines which kinds bind to hgraf.task_id attributes for task state derivation. Don't auto-bind a new kind without thinking through whether it's meaningful.SPAN_KIND_CUSTOM + kind_string for per-framework extension. If only one framework needs it, use CUSTOM.