Skip to content

refactor: ScoreBreakdown struct fields → v2.1 names (deferred debt from cc4361f)#58

Open
ubercylon8 wants to merge 1 commit into
mainfrom
refactor/scorebreakdown-v2.1-fields
Open

refactor: ScoreBreakdown struct fields → v2.1 names (deferred debt from cc4361f)#58
ubercylon8 wants to merge 1 commit into
mainfrom
refactor/scorebreakdown-v2.1-fields

Conversation

@ubercylon8
Copy link
Copy Markdown
Owner

Summary

Resolves the ScoreBreakdown struct field rename that was explicitly deferred across two rubric activations:

  • 237f2b1 (v2 rubric activation, 2026-04-24): deferred due to sweep scope — "requires a coordinated sweep across all 45+ contracts"
  • cc4361f (v2.1 rubric activation, 2026-04-25): re-deferred for same reason, documented in docs/PROPOSED_RUBRIC_V2.1_SIGNAL_QUALITY.md §"Deferred (out of scope for v2.1 activation)"

This PR closes that debt by sweeping all 48 per-test test_logger.go copies + the canonical template + all 35 test *.go files that initialise ScoreBreakdown{}.


Field Mapping

Renamed (5 fields)

Old Go field Old JSON key New Go field New JSON key v2.1 budget
RealWorldAccuracy realWorldAccuracy APIFidelity apiFidelity 0–2.5 (2a)
TechnicalSophistication technicalSophistication IdentifierFidelity identifierFidelity 0–1.5 (2b)
SafetyMechanisms safetyMechanisms TelemetrySignalQuality telemetrySignalQuality 0–2.0 (2c)
DetectionOpportunities detectionOpportunities ExecutionContextFidelity executionContextFidelity 0–1.0 (2d)
LoggingObservability loggingObservability SchemaMetadata schemaMetadata 0–1.0 (3a)

Added (3 new fields)

New Go field New JSON key v2.1 budget
DocumentationCompleteness documentationCompleteness 0–1.0 (3b)
LoggingPlumbing loggingPlumbing 0–0.5 (3c)
OperationalHygiene operationalHygiene 0–0.5 (3d)

Mapping rationale for legacy tests (v1/v2 — compilation only, no re-scoring)

Legacy tests preserve their existing numeric values; the field names are renamed to the closest semantic v2.1 equivalents. The three new fields default to 0.0. No Score or RubricVersion values were modified.

Full rationale: docs/SCOREBREAKDOWN_FIELD_MIGRATION.md


Scope

  • 86 files changed (commit e433f07)
  • 48 × test_logger.go struct definition (all per-test copies + canonical template)
  • 36 × test *.go struct initialisations (35 tests + TEMPLATE-UUID.go)
  • 1 × docs/SCOREBREAKDOWN_FIELD_MIGRATION.md (new)
  • gofmt -l clean on all changed files ✅
  • Zero new go vet errors (all failures are pre-existing: missing embedded binaries, missing platform files)

Consumer-side work needed before merge

⚠️ This is a hard wire-format cutover. The JSON keys in scoreBreakdown.* change. Two consumers must be updated before results from post-merge builds are ingested:

1. ProjectAchilles (~/F0RT1KA/ProjectAchilles/)

Both backend/ and backend-serverless/ must be updated in lockstep (they are mirrors — drift causes silent data drops):

  • src/services/browser/metadataExtractor.ts — replace old regex extractions with new field names
  • src/types/test.ts — rename fields in TestMetadata/TestDetails/ScoreBreakdown interface
  • src/services/browser/testIndexer.ts — wire new fields through indexer pipeline
  • src/services/agent/test-catalog.service.ts — update catalog persistence/lookup
  • src/services/browser/__tests__/metadataExtractor.test.ts — update extraction tests

Detailed code snippets in docs/SCOREBREAKDOWN_FIELD_MIGRATION.md §"ProjectAchilles".

2. Elasticsearch indices (achilles-results-*)

  • Update Kibana dashboards/saved searches that reference old field names (scoreBreakdown.realWorldAccuracy, etc.)
  • Existing documents retain old field names; new documents use new names — cross-version queries should branch on testMetadata.rubricVersion

References

  • docs/SCOREBREAKDOWN_FIELD_MIGRATION.md — full migration guide
  • docs/PROPOSED_RUBRIC_V2.1_SIGNAL_QUALITY.md — rubric spec (§"Deferred" section documents the debt this PR closes)
  • Deferred in: 237f2b1, cc4361f
  • Re-scored triad: 7b05b7c

Generated by Claude Code

…sions across 46 copies

Resolves deferred technical debt from commits 237f2b1 (v2 rubric activation)
and cc4361f (v2.1 rubric activation), both of which deferred renaming the
ScoreBreakdown struct fields in test_logger.go due to sweep scope.

Changes:
- Rename 5 existing fields (v1 names → v2.1 sub-dimension names):
    RealWorldAccuracy       → APIFidelity
    TechnicalSophistication → IdentifierFidelity
    SafetyMechanisms        → TelemetrySignalQuality
    DetectionOpportunities  → ExecutionContextFidelity
    LoggingObservability    → SchemaMetadata
- Add 3 new v2.1 structure sub-dimensions:
    DocumentationCompleteness (3b, 0–1.0)
    LoggingPlumbing           (3c, 0–0.5)
    OperationalHygiene        (3d, 0–0.5)
- Propagated to all 48 per-test test_logger.go copies (10 cyber-hygiene,
  28 intel-driven, 9 mitre-top10) via scripted sweep
- Updated 35 test *.go files that initialise ScoreBreakdown{} with old
  field names; field values preserved (no re-scoring)
- Updated TEMPLATE-UUID.go with v2.1-idiomatic defaults and comments
- gofmt -l clean on all changed files
- go vet failures on checked tests are all pre-existing (missing embedded
  binaries, missing platform files) — zero new errors

Field mapping rationale for legacy v1/v2 tests is documented in
docs/SCOREBREAKDOWN_FIELD_MIGRATION.md along with the consumer migration
guide for ProjectAchilles and Elasticsearch.

BREAKING CHANGE: JSON wire format of scoreBreakdown object changes.
PA backend and ES consumers must update field readers before ingesting
results from tests built after this commit. See migration guide.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

https://claude.ai/code/session_018D5p6BDpfPpCLu7YT97Nsj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants