MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / k7

Function k7

graph-ui/tools/handtest-fixes-chat.mjs:478–539  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

476}
477
478async function k7(page) {
479 const outputs = [];
480 // Galaxy, incoming and CALLS only: the case of the hand test at 17:20.
481 await galaxyWithJsonb(page);
482 await explanationDone(page);
483 let mark = await markWorker(page), from = await now(page);
484 await setTrace(page, 'inbound', 'CALLS');
485 await explanationDone(page);
486 let [request] = (await sentSince(page, mark)).filter((entry) => entry.profile === 'automatic-explanation');
487 let card = await explanationText(page);
488 outputs.push({ selection: 'JSONBAgg incoming CALLS', card, model: (await answersSince(page, from))[0]?.output, prompt: promptText(request) });
489 await shot(page, 'K7', 'galaxy-incoming-calls', 'JSONBAgg, incoming, CALLS only: listed facts, at most one model sentence, no "list of integers / list of strings".');
490 const galaxyOk = Boolean(request) && /Incoming: 11 relationships from 11 symbols \(CALLS 11\)/.test(card) && !/list of (?:integers|strings)|output is/i.test(card)
491 && /Never state types, parameters, inputs, outputs/.test(promptText(request)) && /class JSONBAgg\(OrderableAggMixin, Aggregate\)/.test(promptText(request));
492 // Architecture, Overview: the django area (hand test 17:53).
493 await tab(page, 'architecture');
494 await openChat(page);
495 await page.getByRole('button', { name: 'Overview', exact: true }).click();
496 await wait(5000);
497 await page.getByText(/Browse map/).first().click();
498 await wait(600);
499 mark = await markWorker(page); from = await now(page);
500 await page.locator('button', { hasText: /^djangoarea/ }).first().click();
501 await wait(1500);
502 await explanationDone(page);
503 [request] = (await sentSince(page, mark)).filter((entry) => entry.profile === 'automatic-explanation');
504 card = await explanationText(page);
505 outputs.push({ selection: 'Architecture overview django area', card, model: (await answersSince(page, from))[0]?.output, prompt: promptText(request) });
506 await shot(page, 'K7', 'architecture-area', 'Architecture overview, django area: readable facts (files, lines, languages, hotspots, connections), no "Finding a line number" list.');
507 // Without source the listed facts are the explanation; the model is not asked to guess.
508 const areaOk = !request && /Selected source area: django/.test(card) && /Connections /.test(card) && !/Selected\.|members\[\d+\]|startLine|Finding a|Visible operations/.test(card)
509 && /not generated by the model/.test(card);
510 // The same area opened, with nothing selected inside it (hand test 17:55): facts about the area, not "Opened: django".
511 mark = await markWorker(page); from = await now(page);
512 await page.getByRole('button', { name: 'Open area →' }).first().click();
513 await wait(2500);
514 await explanationDone(page);
515 [request] = (await sentSince(page, mark)).filter((entry) => entry.profile === 'automatic-explanation');
516 const openedCard = await explanationText(page);
517 // The card counts the parts the view counts ("23 parts · 100 connections"): inside the area and outside it.
518 const viewParts = /([\d,]+) parts? · [\d,]+ connections?/.exec(await page.locator('.atlas-workspace-stage').innerText().catch(() => ''))?.[1] ?? null;
519 const cardParts = /Parts shown \(([\d,]+)/.exec(openedCard)?.[1] ?? null;
520 outputs.push({ selection: 'Architecture overview, django opened, nothing selected', card: openedCard, model: (await answersSince(page, from))[0]?.output, prompt: promptText(request), viewParts, cardParts });
521 await shot(page, 'K7', 'architecture-area-opened', 'Overview inside django with nothing selected: the card names the opened area, its lines and languages, the parts shown, its hotspot findings and the connections between its parts.');
522 const openedOk = !request && /Opened source area: django\./.test(openedCard) && /indexed lines in [\d,]+ measured files of [\d,]+; files by language: /.test(openedCard)
523 && /Parts shown \([\d,]+(?:, largest first\)|\): [\d,]+ inside the area, largest first): /.test(openedCard) && viewParts !== null && cardParts === viewParts && /hotspot findings?: /.test(openedCard) && /Connections of its parts: /.test(openedCard) && /not generated by the model/.test(openedCard)
524 && !/^Opened: /m.test(openedCard);
525 // Architecture, Behavior: main of manage.py-tpl.
526 mark = await markWorker(page); from = await now(page);
527 await page.getByRole('button', { name: 'Behavior' }).click();
528 await wait(6000);
529 await explanationDone(page);
530 [request] = (await sentSince(page, mark)).filter((entry) => entry.profile === 'automatic-explanation');
531 card = await explanationText(page);
532 outputs.push({ selection: 'Architecture behavior', card, model: (await answersSince(page, from))[0]?.output, prompt: promptText(request) });
533 await shot(page, 'K7', 'architecture-behavior', 'Architecture Behavior: the starting operation, its call sites with the functions they reach (os.environ.setdefault, execute_from_command_line), no invented operations.');
534 const behaviorOk = /Starting operation: main/.test(card) && (!request || /def main\(\)/.test(promptText(request))) && !/Finding a|Visible operations/.test(card)
535 && /line 9 calls os\.environ\.setdefault/.test(card) && /line 18 calls execute_from_command_line/.test(card);

Callers

nothing calls this directly

Calls 15

galaxyWithJsonbFunction · 0.85
explanationDoneFunction · 0.85
markWorkerFunction · 0.85
setTraceFunction · 0.85
sentSinceFunction · 0.85
explanationTextFunction · 0.85
answersSinceFunction · 0.85
promptTextFunction · 0.85
openChatFunction · 0.85
nowFunction · 0.70
shotFunction · 0.70
tabFunction · 0.70

Tested by

no test coverage detected