fix(report): keep actionNotes within the document cap at assemble
Five-theme personal_full still failed final parse after the charts cap fix because writer output exceeded actionNotes.max(24). Truncate at assemble; do not raise the schema cap. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
type ReportEvidenceBundleV2,
|
||||
type TechniqueExecutionReceipt,
|
||||
} from "../src/lib/report-evidence-bundle-v2.ts";
|
||||
import { CHART_IDS } from "../src/lib/personal-report-contract.ts";
|
||||
import { CHART_IDS, REPORT_DOCUMENT_V2_ACTION_NOTES_MAX } from "../src/lib/personal-report-contract.ts";
|
||||
import {
|
||||
classifyFinalParseInnerReason,
|
||||
classifyReportSchemaInnerReason,
|
||||
@@ -392,6 +392,29 @@ test("five-theme sectioned pipeline with the full CHART_IDS set finishes READY",
|
||||
assert.deepEqual(sectionCalls, ["career", "health", "marriage", "timing", "wealth"]);
|
||||
});
|
||||
|
||||
test("five-theme assemble keeps actionNotes within the document cap", async () => {
|
||||
const bundle = makeBundle({
|
||||
themes: standardFiveThemes,
|
||||
charts: CHART_IDS.map((id, offset) => chart(id, offset)),
|
||||
});
|
||||
const inner = sectionedAgent({});
|
||||
const agent: ReportAgentPort = {
|
||||
...inner,
|
||||
async generateSection(sectionBundle, section, completedTitles, options) {
|
||||
const output = await inner.generateSection!(sectionBundle, section, completedTitles, options);
|
||||
return {
|
||||
...output,
|
||||
actions: Array.from({ length: 6 }, (_, index) => (
|
||||
`围绕${output.title}记录可验证的现实反馈 ${index + 1}`
|
||||
)),
|
||||
};
|
||||
},
|
||||
};
|
||||
const document = readyV2(await runSectioned(bundle, agent, inMemorySectionService()));
|
||||
assert.equal(document.actionNotes.length, REPORT_DOCUMENT_V2_ACTION_NOTES_MAX);
|
||||
assert.equal(document.blockedConflictDisclosure.length, 0);
|
||||
});
|
||||
|
||||
test("generatePersonalReport passes the worker lease signal to the writer and settles when aborted", async () => {
|
||||
const bundle = makeBundle({
|
||||
themes: [{
|
||||
|
||||
Reference in New Issue
Block a user