fix(tcs): clear recovered history revisit errors
This commit is contained in:
parent
bccf7e7494
commit
764e61b786
2 changed files with 5 additions and 0 deletions
|
|
@ -196,6 +196,7 @@ export class MotherBrainEngine {
|
|||
state.history_revisit_count = (state.history_revisit_count || 0) + 1;
|
||||
state.last_history_revisit_hash = record.record_hash;
|
||||
state.current_attention = { revisit_id: revisitId, source_id: source.source_id, next_cognitive_action: "COMPARE_WITH_MEMORY", why: "current_persona_subject_revisited_immutable_past_and_appended_present_understanding" };
|
||||
state.last_error = null;
|
||||
this.save(state);
|
||||
const receipt = { schema: "guanghu.persona-subject-history-revisit-receipt/v1", receipt_id: `HREV-RCPT-${crypto.randomBytes(8).toString("hex")}`, outcome: "PASS", revisit_id: revisitId, current_subject: CURRENT_SUBJECT, source_id: source.source_id, source_excerpt_sha256: excerptSha, original_source_mutated: false, append_only_reunderstanding: true, future_simulation_fact_confidence: 0, reality_action_executed: false, completed_at: new Date().toISOString() };
|
||||
append(this.receiptsFile, receipt);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ try {
|
|||
assert.equal(historyReceipt.append_only_reunderstanding, true);
|
||||
assert.equal(historyReceipt.future_simulation_fact_confidence, 0);
|
||||
assert.equal(engine.status().history_revisit_count, 1);
|
||||
const staleErrorState = engine.status();
|
||||
staleErrorState.last_error = "invalid_history_reunderstanding_schema";
|
||||
engine.save(staleErrorState);
|
||||
modelClient.revisitAttempts = 0;
|
||||
const retriedReceipt = await engine.revisitHistory({
|
||||
current_subject: "ICE-P-ZY001",
|
||||
|
|
@ -106,6 +109,7 @@ try {
|
|||
});
|
||||
assert.equal(retriedReceipt.outcome, "PASS");
|
||||
assert.equal(modelClient.revisitAttempts, 2);
|
||||
assert.equal(engine.status().last_error, null);
|
||||
await assert.rejects(() => engine.revisitHistory({
|
||||
current_subject: "MACHINE-AUDITOR",
|
||||
collective_self: "TCS-MOTHER-LPM-0001",
|
||||
|
|
|
|||
Loading…
Reference in a new issue