Internal

internal/app/report

Package report aggregates workspace-level task metrics.

import "github.com/nilstate/scafld/v2/internal/app/report"

Package report aggregates workspace-level task metrics.

Functions

func Run(ctx context.Context, store SpecStore, sessions SessionStore) (Output, error)

Source: internal/app/report/report.go:60

Run aggregates spec records by status and session evidence by task.

Types

type ArchiveAwareSpecStore

Source: internal/app/report/report.go:17

ArchiveAwareSpecStore can include archived terminal specs in reports.

type ArchiveAwareSpecStore interface {
	ListAll(context.Context) ([]spec.Record, error)
}
Methods
  • ListAll func(context.Context) ([]spec.Record, error)

type Metrics

Source: internal/app/report/report.go:34

Metrics captures the reporting surface scafld uses to judge protocol quality.

type Metrics struct {
	FirstAttemptPassRate      float64        `json:"first_attempt_pass_rate"`
	FirstAttemptPasses        int            `json:"first_attempt_passes"`
	FirstAttemptTotal         int            `json:"first_attempt_total"`
	RecoveryConvergenceRate   float64        `json:"recovery_convergence_rate"`
	RecoveredTasks            int            `json:"recovered_tasks"`
	RecoveryTotal             int            `json:"recovery_total"`
	ChallengeOverrideRate     float64        `json:"challenge_override_rate"`
	ChallengeOverrides        int            `json:"challenge_overrides"`
	ReviewChallengeTotal      int            `json:"review_challenge_total"`
	ReviewPassRate            float64        `json:"review_pass_rate"`
	ReviewPasses              int            `json:"review_passes"`
	ReviewTotal               int            `json:"review_total"`
	ReviewDossierCoverage     float64        `json:"review_dossier_coverage"`
	ReviewDossierTotal        int            `json:"review_dossier_total"`
	ReviewFindingsTotal       int            `json:"review_findings_total"`
	ReviewOpenBlockersTotal   int            `json:"review_open_blockers_total"`
	ReviewAttackAnglesTotal   int            `json:"review_attack_angles_total"`
	ReviewModeDistribution    map[string]int `json:"review_mode_distribution,omitempty"`
	WorkspaceBaselineCoverage float64        `json:"workspace_baseline_coverage"`
	WorkspaceBaselineTasks    int            `json:"workspace_baseline_tasks"`
	SessionTotal              int            `json:"session_total"`
	BlockedGateDistribution   map[string]int `json:"blocked_gate_distribution,omitempty"`
}
Fields
  • FirstAttemptPassRate float64 `json:"first_attempt_pass_rate"`
  • FirstAttemptPasses int `json:"first_attempt_passes"`
  • FirstAttemptTotal int `json:"first_attempt_total"`
  • RecoveryConvergenceRate float64 `json:"recovery_convergence_rate"`
  • RecoveredTasks int `json:"recovered_tasks"`
  • RecoveryTotal int `json:"recovery_total"`
  • ChallengeOverrideRate float64 `json:"challenge_override_rate"`
  • ChallengeOverrides int `json:"challenge_overrides"`
  • ReviewChallengeTotal int `json:"review_challenge_total"`
  • ReviewPassRate float64 `json:"review_pass_rate"`
  • ReviewPasses int `json:"review_passes"`
  • ReviewTotal int `json:"review_total"`
  • ReviewDossierCoverage float64 `json:"review_dossier_coverage"`
  • ReviewDossierTotal int `json:"review_dossier_total"`
  • ReviewFindingsTotal int `json:"review_findings_total"`
  • ReviewOpenBlockersTotal int `json:"review_open_blockers_total"`
  • ReviewAttackAnglesTotal int `json:"review_attack_angles_total"`
  • ReviewModeDistribution map[string]int `json:"review_mode_distribution,omitempty"`
  • WorkspaceBaselineCoverage float64 `json:"workspace_baseline_coverage"`
  • WorkspaceBaselineTasks int `json:"workspace_baseline_tasks"`
  • SessionTotal int `json:"session_total"`
  • BlockedGateDistribution map[string]int `json:"blocked_gate_distribution,omitempty"`

type Output

Source: internal/app/report/report.go:27

Output summarizes workspace task counts and session-derived product metrics.

type Output struct {
	Total    int                 `json:"total"`
	ByStatus map[spec.Status]int `json:"by_status"`
	Metrics  Metrics             `json:"metrics"`
}
Fields
  • Total int `json:"total"`
  • ByStatus map[spec.Status]int `json:"by_status"`
  • Metrics Metrics `json:"metrics"`

type SessionStore

Source: internal/app/report/report.go:22

SessionStore lists session ledgers used for evidence-derived metrics.

type SessionStore interface {
	List(context.Context) ([]session.Session, error)
}
Methods
  • List func(context.Context) ([]session.Session, error)

type SpecStore

Source: internal/app/report/report.go:12

SpecStore is the spec listing port used by reports.

type SpecStore interface {
	List(context.Context) ([]spec.Record, error)
}
Methods
  • List func(context.Context) ([]spec.Record, error)