feat(pipeline): enhance verification scripts and pipeline

- verify_phase6.sh: improve phase 6 verification logic
- report_utils.sh: update report generation utilities
- run_daily.sh: harden daily pipeline execution
- run_intel_pipeline.sh: improve intel pipeline runner
- run_real_pipeline.sh: improve real pipeline runner
- generate_daily_report.go: enhance daily report generation
This commit is contained in:
phamnazage-jpg
2026-05-22 07:33:45 +08:00
parent 8d1312203f
commit 567d1f89ec
6 changed files with 185 additions and 91 deletions

View File

@@ -308,25 +308,25 @@ type SignatureAuditSourceSummary struct {
}
type SignatureAuditReportRow struct {
SourceKey string
SourceLabel string
RecentRank int
CheckedAt string
StructureState string
StructureChanged bool
Status string
DriftDetected bool
BaselineInitialized bool
StructureSHA256 string
SourceKey string
SourceLabel string
RecentRank int
CheckedAt string
StructureState string
StructureChanged bool
Status string
DriftDetected bool
BaselineInitialized bool
StructureSHA256 string
PreviousStructureSHA256 string
SnapshotPath string
SignaturePath string
ErrorMessage string
SnapshotPath string
SignaturePath string
ErrorMessage string
}
type SignatureAuditReportConfig struct {
Window int
ChangedRunsThreshold int
Window int
ChangedRunsThreshold int
}
type FreeSourceStat struct {
@@ -713,7 +713,7 @@ func generateReportDataV3(db *sql.DB, date string) (*ReportV3, error) {
func loadMaterializedDailySignalSnapshot(db *sql.DB, date string) (DailySignals, []ModelEvent, bool, error) {
var (
signals DailySignals
signals DailySignals
rawTopEvents string
)
err := db.QueryRow(`
@@ -3380,34 +3380,24 @@ func saveReportTrackingV3(db *sql.DB, r *ReportV3, mdPath string, runContext Rep
}
defer tx.Rollback()
if _, err := tx.Exec(`
INSERT INTO daily_report (report_date, status, model_count, new_models, free_models, summary_md, output_path, run_kind, trigger_source, is_official_daily, updated_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, NOW())
ON CONFLICT (report_date) DO UPDATE SET
status = EXCLUDED.status,
model_count = EXCLUDED.model_count,
free_models = EXCLUDED.free_models,
summary_md = EXCLUDED.summary_md,
output_path = EXCLUDED.output_path,
run_kind = CASE
WHEN EXCLUDED.is_official_daily THEN EXCLUDED.run_kind
WHEN daily_report.trigger_source = 'legacy_backfill' THEN EXCLUDED.run_kind
ELSE daily_report.run_kind
END,
trigger_source = CASE
WHEN EXCLUDED.is_official_daily THEN EXCLUDED.trigger_source
WHEN daily_report.trigger_source = 'legacy_backfill' THEN EXCLUDED.trigger_source
ELSE daily_report.trigger_source
END,
is_official_daily = CASE
WHEN EXCLUDED.is_official_daily THEN TRUE
WHEN daily_report.trigger_source = 'legacy_backfill' THEN EXCLUDED.is_official_daily
ELSE daily_report.is_official_daily
END,
error_message = NULL,
updated_at = NOW()
`, r.Date, "generated", r.TotalModels, 0, len(r.FreeModels), summary, mdPath, runContext.RunKind, runContext.TriggerSource, runContext.IsOfficialDaily); err != nil {
return err
if runContext.IsOfficialDaily {
if _, err := tx.Exec(`
INSERT INTO daily_report (report_date, status, model_count, new_models, free_models, summary_md, output_path, run_kind, trigger_source, is_official_daily, updated_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, NOW())
ON CONFLICT (report_date) DO UPDATE SET
status = EXCLUDED.status,
model_count = EXCLUDED.model_count,
free_models = EXCLUDED.free_models,
summary_md = EXCLUDED.summary_md,
output_path = EXCLUDED.output_path,
run_kind = EXCLUDED.run_kind,
trigger_source = EXCLUDED.trigger_source,
is_official_daily = TRUE,
error_message = NULL,
updated_at = NOW()
`, r.Date, "generated", r.TotalModels, 0, len(r.FreeModels), summary, mdPath, runContext.RunKind, runContext.TriggerSource, runContext.IsOfficialDaily); err != nil {
return err
}
}
if _, err := tx.Exec(`