Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/test-agentic-evidence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ jobs:
go: true
go-version: "1.24.4"

- name: Sync C2 evidence from slim-integration (optional)
continue-on-error: true
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: test-slim-integration.yaml
commit: ${{ github.sha }}
name: slim-integration-test-result
path: integrations/agntcy-slim/topology/reports
if_no_artifact_found: ignore

- name: Run agentic evidence tests and build dashboard
id: agentic-dashboard
working-directory: analitics
Expand Down
28 changes: 20 additions & 8 deletions analitics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ analitics/
│ ├── echo-client/ # Responder/sink helper
│ └── rate-client/ # Traffic generator
├── tests/
│ ├── c1_evidence_test.go
│ └── c1_evidence_report.go
│ ├── suite_test.go # Ginkgo bootstrap
│ ├── c1_evidence_test.go # C1 use-case specs + behavioral assertions
│ ├── c1_evidence_report.go # JSON report model + upsert helpers
│ └── c1_evidence_report_test.go # unit tests for the report helpers
├── templates/
│ └── dashboard.html.tmpl
├── scripts/
│ ├── evidence-lib.sh
│ ├── render-dashboard.sh
│ └── render-evidence-report.sh
├── bin/ # generated (gitignored): downloaded slimctl
├── reports/ # generated (gitignored)
└── published/ # generated (gitignored)
├── index.html
Expand All @@ -95,18 +98,26 @@ analitics/

- Epic: `docs/plans/slim-dashboard-epic.md`
- C1 contract: `docs/plans/slim-c1-evidence-contract-v1.md`
- C2 contract: `docs/plans/slim-c2-evidence-contract-v1.md`

## Status evaluation (C1)

C1 use-case status is derived from `reports/c1-evidence.json`
(produced by Ginkgo tests in `tests/c1_evidence_test.go`):
C1 use-case status is read from the `status` field of each case in
`reports/c1-evidence.json` (produced by Ginkgo tests in `tests/c1_evidence_test.go`):

- `verified` — assertion-based test passed for the mode
- `failed` — test failed or case reports non-zero errors
- `unknown` — no case entry for the mode
- `verified` — the mode's behavioral assertions passed; the test records this case as `verified`
- `failed` — the case is recorded with a `failed` status
- `unknown` — no case entry exists for the mode (e.g. the report is missing or the spec did not run)

The render step reads these values as-is; it does not re-run or re-evaluate the tests.

C2/C3 rows use static status until their test evidence is wired into the build flow.

**C2 (topology routing):** status for `c2-topology-routing` is read from `c2-evidence.json`
(produced by TopologyTest in `integrations/agntcy-slim/topology/tests`). Synced into
`analitics/reports/` automatically from `integrations/agntcy-slim/topology/reports/` during
`dashboard:sync`. See `docs/plans/slim-c2-evidence-contract-v1.md`.

## GitHub Pages

On `main`, the `test-agentic-evidence` workflow publishes the generated dashboard to the shared
Expand All @@ -116,7 +127,8 @@ CSIT test reports site under **`docs/agentic-evidence/`** on the `gh-pages` bran

## Prerequisites

- Go 1.22+
- Go 1.24+ (matches `go.mod`)
- `task` in the shell
- `jq` and `bash` on `PATH` (used by the render scripts)
- Native SLIM bindings for CGO (`task -t analitics/Taskfile.yml deps:slim-bindings-setup`)
- `slimctl` on `PATH`, or install via `task -t analitics/Taskfile.yml deps:slimctl-download`
23 changes: 21 additions & 2 deletions analitics/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ tasks:
- mkdir -p "{{.REPORTS_DIR}}" "{{.PUBLISHED_DIR}}/evidence"

dashboard:sync:
desc: Copy c1-evidence.json into published/evidence
desc: Copy C1/C2 evidence JSON into published/evidence
deps: [dashboard:prepare]
cmds:
- |
Expand All @@ -73,9 +73,22 @@ tasks:
if [ -f "$REPORTS_ABS/c1-evidence.json" ]; then
cp "$REPORTS_ABS/c1-evidence.json" "{{.PUBLISHED_DIR}}/evidence/c1-evidence.json"
fi
C2_SOURCE="${C2_EVIDENCE_SOURCE:-}"
if [ -z "$C2_SOURCE" ] && [ ! -f "$REPORTS_ABS/c2-evidence.json" ]; then
TOPOLOGY_C2="../integrations/agntcy-slim/topology/reports/c2-evidence.json"
if [ -f "$TOPOLOGY_C2" ]; then
C2_SOURCE="$TOPOLOGY_C2"
fi
fi
if [ -n "$C2_SOURCE" ] && [ -f "$C2_SOURCE" ]; then
cp "$C2_SOURCE" "$REPORTS_ABS/c2-evidence.json"
cp "$C2_SOURCE" "{{.PUBLISHED_DIR}}/evidence/c2-evidence.json"
elif [ -f "$REPORTS_ABS/c2-evidence.json" ]; then
cp "$REPORTS_ABS/c2-evidence.json" "{{.PUBLISHED_DIR}}/evidence/c2-evidence.json"
fi

dashboard:render:
desc: Render taxonomy dashboard and C1 evidence reports from JSON
desc: Render taxonomy dashboard and evidence reports from JSON
deps: [dashboard:prepare]
cmds:
- |
Expand All @@ -88,6 +101,9 @@ tasks:
REPORTS_DIR="$REPORTS_ABS" \
OUTPUT_DIR="{{.PUBLISHED_DIR}}/evidence" \
bash ./scripts/render-evidence-report.sh
REPORTS_DIR="$REPORTS_ABS" \
OUTPUT_DIR="{{.PUBLISHED_DIR}}/evidence" \
bash ./scripts/render-c2-evidence-report.sh

dashboard:build:only:
desc: Sync evidence JSON and render dashboard (skip test run)
Expand All @@ -106,6 +122,9 @@ tasks:
- rm -f "{{.PUBLISHED_DIR}}/evidence/c1-evidence.json"
- rm -f "{{.PUBLISHED_DIR}}/evidence/c1-evidence.md"
- rm -f "{{.PUBLISHED_DIR}}/evidence/c1-evidence.html"
- rm -f "{{.PUBLISHED_DIR}}/evidence/c2-evidence.json"
- rm -f "{{.PUBLISHED_DIR}}/evidence/c2-evidence.md"
- rm -f "{{.PUBLISHED_DIR}}/evidence/c2-evidence.html"

test:agentic-evidence:
desc: Run all agentic evidence class tests (currently C1 only)
Expand Down
90 changes: 89 additions & 1 deletion analitics/scripts/evidence-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ evidence_json() {
echo "${REPORTS_DIR}/c1-evidence.json"
}

c2_evidence_json() {
if [[ -n "${C2_EVIDENCE_JSON:-}" ]]; then
echo "$C2_EVIDENCE_JSON"
return 0
fi
if [[ -f "${REPORTS_DIR}/c2-evidence.json" ]]; then
echo "${REPORTS_DIR}/c2-evidence.json"
return 0
fi
echo "${REPORTS_DIR}/c2-evidence.json"
}

mode_status() {
local mode="$1"
local json_file
Expand Down Expand Up @@ -47,12 +59,88 @@ mode_rows() {
jq -r --arg mode "$mode" '[.cases[] | select(.mode == $mode)] | length' "$json_file" 2>/dev/null || echo "0"
}

row_status() {
local row_id="$1"
local expected_scenarios="${2:-0}"
local json_file
json_file="$(c2_evidence_json)"

if [[ ! -f "$json_file" ]]; then
echo "unknown"
return 0
fi

if ! command -v jq >/dev/null 2>&1; then
echo "unknown"
return 0
fi

local statuses
statuses="$(jq -r --arg row_id "$row_id" '[.cases[] | select(.row_id == $row_id) | .status] | .[]' "$json_file" 2>/dev/null)"
if [[ -z "$statuses" ]]; then
echo "unknown"
return 0
fi

local status verified_count=0 failed_count=0 total_count=0
while IFS= read -r status; do
[[ -z "$status" || "$status" == "null" ]] && continue
total_count=$((total_count + 1))
case "$status" in
failed) failed_count=$((failed_count + 1)) ;;
verified) verified_count=$((verified_count + 1)) ;;
esac
done <<< "$statuses"

if [[ "$failed_count" -gt 0 ]]; then
echo "failed"
return 0
fi
if [[ "$verified_count" -eq 0 ]]; then
echo "unknown"
return 0
fi
if [[ "$expected_scenarios" -gt 0 ]]; then
if [[ "$verified_count" -eq "$expected_scenarios" ]]; then
echo "verified"
return 0
fi
if [[ "$verified_count" -lt "$expected_scenarios" ]]; then
echo "partial"
return 0
fi
fi
if [[ "$verified_count" -eq "$total_count" ]]; then
echo "verified"
return 0
fi
echo "unknown"
}

row_scenario_count() {
local row_id="$1"
local json_file
json_file="$(c2_evidence_json)"

if [[ ! -f "$json_file" ]]; then
echo "0"
return 0
fi

if ! command -v jq >/dev/null 2>&1; then
echo "0"
return 0
fi

jq -r --arg row_id "$row_id" '[.cases[] | select(.row_id == $row_id)] | length' "$json_file" 2>/dev/null || echo "0"
}

status_label() {
case "$1" in
verified) echo "Verified" ;;
failed) echo "Failed" ;;
partial) echo "Partial" ;;
planned) echo "Planned" ;;
planned) echo "Evidence pending" ;;
*) echo "Unknown" ;;
esac
}
Expand Down
Loading
Loading