Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ before materializing requested evaluations. Source fingerprinting still reads
every admitted byte and rechecks freshness; sequential reads avoid starting a
thread pool in each process. Healthy read commands use canonical registry/path
owners and defer mutation error imports until needed.
Exact detail queries push selection into the existing source projection after
complete source validation. Queries that report unfiltered counts retain the
complete first projection.
The output measurements above retain their original controlled-transport scope.
[#6874](https://github.com/loopx-project/loopx/pull/6874) records the original
normal-IPC, package and complete-command evidence. Follow-up measurements apply
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ Canonical 摘要仅在某角色组包含恢复条件时准备恢复历史。
该 owner 先校验并索引完整图,再生成需要返回的评估。
源码指纹仍读取每个已准入字节并复查新鲜度;顺序读取省去每个进程的线程池创建。
正常读取直接使用注册表和路径的 canonical owner,发生错误时才导入相关错误类型。
精确详情查询在完整来源校验后,将筛选下推到既有来源投影。
需报告未筛选数量的查询仍保留完整的首次投影。
上述输出测量保留原受控传输范围。
[#6874](https://github.com/loopx-project/loopx/pull/6874) 记录原始正常 IPC、安装包及完整命令证据。
后续测量仅适用于各自记录的精确版本。
Expand Down
3 changes: 3 additions & 0 deletions loopx/control_plane/todos/read_projection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ export async function projectCanonicalTodoFields(input: JsonObject): Promise<Jso
const checksConfigured = configuredGoalChecks(acceptance) !== null;
const lineage = Array.isArray(input.lineage) ? input.lineage.map(value => requireJsonObject(value, "Todo lineage")) : all;
const lineageFacts = input.lineage_facts ?? lineage.map(successionFacts);
const query = input.kind === "query" && input.selection == null ? object(input.query) : {};
const detailId = query.agent_id == null && query.limit == null ? query.todo_id : null;
const fields: JsonObject = {}, evaluations: JsonObject = {};
for (const role of ["user", "agent"]) {
const section = role === "agent" ? "Agent Todo" : "User Todo / Owner Review Reading Queue";
Expand All @@ -214,6 +216,7 @@ export async function projectCanonicalTodoFields(input: JsonObject): Promise<Jso
...(input.retained !== true && checksConfigured && guards[text(row.todo_id)] ? {goal_acceptance_guard: guards[text(row.todo_id)]} : {})}, role, section,
input.retained === true ? null : 500, input.retained !== true));
const grouped = await projectTodoReadGroup({...input, items, lineage, lineage_facts: lineageFacts, evaluated: false, role, source_section: section,
selection: typeof detailId === "string" && detailId ? {role, todo_id: detailId, status: null, agent_id: null} : input.selection ?? null,
item_limit: null, full_selection: true, resume_lineage: items.some(row => readResume(row.resume_when))
? all.map(row => structureCanonicalTodo(row, row.role ?? null, row.source_section ?? section)) : []});
if (grouped.rejection) return grouped;
Expand Down
12 changes: 12 additions & 0 deletions tests/control_plane_ts/todo_read.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ test("query display limits preserve complete source coverage and report the fina
{name: "thin", query: {thin: true}, available: 30, shown: 4},
{name: "references", query: {json_references: true, limit: 1}, available: 30, shown: 2},
{name: "exact", query: {todo_id: items[0].todo_id}, available: 1, shown: 1},
{name: "exact agent scope", query: {todo_id: items[0].todo_id, agent_id: "agent-a"}, available: 1, shown: 1, unfiltered: 30},
{name: "exact limit", query: {todo_id: items[0].todo_id, limit: 1}, available: 1, shown: 1, unfiltered: 30},
{name: "exact other role", query: {todo_id: items[0].todo_id, role: "agent"}, available: 0, shown: 0},
{name: "missing", query: {todo_id: "todo_missing"}, available: 0, shown: 0},
];
for (const scenario of cases) await t.test(scenario.name, async () => {
Expand All @@ -201,5 +204,14 @@ test("query display limits preserve complete source coverage and report the fina
assert.equal(coverage.shown_count, scenario.shown);
assert.equal(coverage.available_count, scenario.available);
assert.equal(coverage.truncated, scenario.shown < scenario.available);
if ("unfiltered" in scenario) assert.equal(payload.unfiltered_todo_count, scenario.unfiltered);
});
const invalidItems = items.map((item, index) => index === 1 ? {...item, updated_at: 123} : item);
const invalid = {...projection, todos: invalidItems,
todo_read_model: coordinationTodoReadModel(invalidItems, TODO_CANONICAL_READ_RECORD_SCHEMA)};
assert.equal((await store.commitAuthority({expected_provider_revision: committed.provider_revision,
operation_id: "invalid-unselected-coordinate", events: [], next_projection: invalid, receipts: []})).status, "applied");
await assert.rejects(() => readTodo({schema_version: TODO_READ_REQUEST, kind: "query",
source: {runtime_root: root, goal_id: goal}, observed_at: Date.parse(now) / 1000, evaluated_at: now,
query: {goal_id: goal, todo_id: items[0].todo_id, read_scope: "active", state_file: state}}), /invalid summary completion coordinates/);
});
Loading