docs: add observability tables reference - #56
Open
Aliciapet11 wants to merge 2 commits into
Open
Conversation
Document the 4 tables added by the observability layer (APPENG-5370): scorecards, gate_results, certifications, observability_metrics. Includes schema diagram, column descriptions, indexes, and constraints.
GuyZivRH
requested changes
Jul 22, 2026
Collaborator
There was a problem hiding this comment.
Consolidated Review: PR #56 — docs: add observability tables reference
What Looks Good
- Schema diagram gives clear visual orientation of relationships
- Pipeline integration section accurately explains how/when tables are populated
- Column-level accuracy is high — types, nullability, indexes, CASCADE behavior all match
abevalflow/db/models.py - Underscore filename follows repo convention
enable-scorecarddefaulttrueis accurate
This is clearly written by carefully reading the model file, not guessed.
Please Fix (Accuracy Issues)
1. eval_engine values omit aeh (line 48)
Doc lists harbor, ase, mcpchecker, a2a, both — but aeh is also a valid value, used throughout scripts/validate.py, analyze.py, publish.py, and set in abevalflow/engines/aeh.py. This is a significant recent addition to omit.
2. gate_name / gate_type omit behavioral (lines 74-75)
Doc says evaluation, security, or quality only. After PR #51, there's also behavioral (GateType.BEHAVIORAL, e.g. policy_key=edge-case in abevalflow/gates/behavioral/edge_case.py).
3. observability_metrics cardinality (schema diagram)
Diagram says 1:1 via pipeline_run_id, but the unique constraint is on (pipeline_run_id, attempt_number), not pipeline_run_id alone. Prefer "one row per run attempt" so retries don't look like a schema bug.
Should Fix (Misleading Today)
4. gate_results token/duration columns (lines 84-86)
duration_ms, prompt_tokens, completion_tokens are documented without caveat, but:
- None of these are actually populated today —
map_gate_results()instore_results.pydoesn't set them - The
GateResultPydantic schema doesn't even haveprompt_tokens/completion_tokensfields @timed_gatedecorator is explicitly for "future use" per its docstring
Theduration_ms"(populated by Phase A when available)" caveat is close but overstates current reality. Add(reserved, not yet populated)to all three to avoid misleading readers into expecting per-gate token data.
Optional Nits
- Add soft link from
Docs/results_persistence_and_observability_plan.mdor README for discoverability - Note that schema arrows are logical (no FK from
evaluation_runstoscorecards) - Could add example queries (pass rate by gate type, token cost over time)
Summary
| Category | Items |
|---|---|
| Must fix | aeh enum value, behavioral gate type/name, cardinality wording |
| Should fix | Token/duration "not yet populated" caveat |
| Optional | Discoverability links, example queries |
| Approve after the three accuracy tweaks. Fine to merge as-is if tracked as follow-up, but for a reference doc I'd fix them in this PR. |
…, mark reserved columns APPENG-5370
Collaborator
Author
|
All 4 items fixed:
|
GuyZivRH
approved these changes
Jul 23, 2026
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
Add documentation for the 4 database tables added by the observability layer (APPENG-5370). Includes schema diagram, column descriptions with types and nullability, indexes, constraints, and relationships.
Tables documented:
scorecards— unified gate verdict per pipeline rungate_results— per-gate normalized resultscertifications— per-level certification resultsobservability_metrics— token usage and timing per runRequested by Guy.