Keep supervised log entries verbatim

This commit is contained in:
npc0-hue
2026-09-02 12:22:41 +08:00
parent 386a295f20
commit 8de49f2dd3
5 changed files with 5 additions and 11 deletions
-3
View File
@@ -63,9 +63,6 @@ func TestWorkerExecutesFencedProtectedProgramAndSpoolsDedicatedLogs(t *testing.T
t.Fatalf("program output used wrong log source: %+v", batch)
}
for _, entry := range batch.Entries {
if entry.Redacted {
t.Fatalf("program log must remain verbatim, got %+v", entry)
}
logLines = append(logLines, entry.Line)
}
}
+2 -4
View File
@@ -1404,7 +1404,6 @@ func checksumForLogEntries(entries []protocol.LogEntry) (string, error) {
Level: entry.Level,
Line: entry.Line,
Fields: entry.Fields,
Redacted: entry.Redacted,
}
}
encoded, err := json.Marshal(stable)
@@ -1421,7 +1420,6 @@ type logEntryChecksumBody struct {
Level string `json:"level,omitempty"`
Line string `json:"line"`
Fields map[string]string `json:"fields,omitempty"`
Redacted bool `json:"redacted"`
}
func (worker *Worker) capacityReport() protocol.RunCapacityReport {
@@ -1524,7 +1522,7 @@ func (sink *LiveLogSink) append(assignment protocol.RunJobAssignment, stream str
FirstSeq: sequence,
LastSeq: sequence,
Compression: "none",
Entries: []protocol.LogEntry{{Seq: sequence, Timestamp: time.Now().UTC(), Level: "info", Line: line, Redacted: false}},
Entries: []protocol.LogEntry{{Seq: sequence, Timestamp: time.Now().UTC(), Level: "info", Line: line}},
}
batch.Checksum, _ = checksumForLogEntries(batch.Entries)
select {
@@ -1576,7 +1574,7 @@ func (sink *SpoolLogSink) append(ctx context.Context, assignment protocol.RunJob
defer sink.mu.Unlock()
streamKey := declaredProcessStreamKey(assignment, stream)
logStreamID := logStreamIDForAssignment(assignment, streamKey)
entry := protocol.LogEntry{Timestamp: time.Now().UTC(), Level: "info", Line: line, Redacted: false}
entry := protocol.LogEntry{Timestamp: time.Now().UTC(), Level: "info", Line: line}
source := "process"
if strings.HasPrefix(stream, "management-program.") {
source = "management-program"
+2 -2
View File
@@ -392,7 +392,7 @@ func TestWorkerSpoolHooksUseRegisteredSession(t *testing.T) {
if err != nil {
t.Fatalf("pending logs: %v", err)
}
if len(logs) != 1 || logs[0].RunEndpointID != "run-test" || logs[0].SessionToken != "session-token" || logs[0].StreamKey != "game.console.stdout" || logs[0].Entries[0].Line != "started password=hidden" || logs[0].Entries[0].Redacted {
if len(logs) != 1 || logs[0].RunEndpointID != "run-test" || logs[0].SessionToken != "session-token" || logs[0].StreamKey != "game.console.stdout" || logs[0].Entries[0].Line != "started password=hidden" {
t.Fatalf("unexpected spooled logs: %+v", logs)
}
chunks, err := artifactQueue.Pending()
@@ -623,7 +623,7 @@ func TestSpoolLogSinkKeepsSequencesIndependentAndDurable(t *testing.T) {
func TestSessionLogBatchClientOverridesSpooledIdentityAndChecksum(t *testing.T) {
recorder := &recordingDurableLogClient{}
entry := protocol.LogEntry{Seq: 7, Timestamp: workerTestTime(), Level: "info", Line: "server ready", Redacted: false}
entry := protocol.LogEntry{Seq: 7, Timestamp: workerTestTime(), Level: "info", Line: "server ready"}
batch := protocol.LogBatchIngestRequest{
RunEndpointID: "old-endpoint",
SessionToken: "old-token",