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
5 changes: 5 additions & 0 deletions CHANGELOG.d/1.8.0-land-first-keyman-related.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 1.8.0 Land first Keyman related nodes

Open Public post from the landed Demo Corp members and Ada West related
nodes sit under the first-Keyman next action. Home list opens still
wait for a Keyman click.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project are documented here. Format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versioning follows
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.0] - 2026-08-17

### Added

- Opening Public post from the landed Demo Corp members now lands
Ada West related nodes under the first-Keyman next action, ahead
of Affiliate tree. Home list opens still wait for a Keyman click.
No TEPP theta is invented. No cutoff body is invented (ADR 0016).

## [1.7.0] - 2026-08-17

### Added
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "frontend",
"private": true,
"version": "1.7.0",
"version": "1.8.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
18 changes: 15 additions & 3 deletions frontend/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@ describe("App, authenticated", () => {
screen.queryByRole("status", { name: "Event Lineage next action" }),
).not.toBeInTheDocument();
expect(screen.queryByRole("status", { name: "Keyman next action" })).not.toBeInTheDocument();
expect(screen.queryByText("Related to Ada West")).not.toBeInTheDocument();
const popup = document.querySelector(".popup-panel");
expect(popup).not.toBeNull();
const evaluation = within(popup as HTMLElement).getByRole("heading", {
Expand Down Expand Up @@ -2314,12 +2315,22 @@ describe("App, authenticated", () => {
expect(keyman.compareDocumentPosition(evaluation) & Node.DOCUMENT_POSITION_FOLLOWING).not.toBe(0);
const keymanNext = await screen.findByRole("status", { name: "Keyman next action" });
expect(keymanNext).toHaveTextContent("Ada West is the first Keyman. Read that person next.");
const related = await within(popup as HTMLElement).findByRole("heading", {
name: "Related to Ada West",
});
expect(within(related.closest(".related-keymen") as HTMLElement).getByText(/Priya Nair/)).toBeInTheDocument();
expect(
evaluation.compareDocumentPosition(keymanNext) & Node.DOCUMENT_POSITION_FOLLOWING,
).not.toBe(0);
within(popup as HTMLElement).getByRole("button", { name: "Related nodes for Ada West" }),
).toHaveAttribute("aria-current", "true");
expect(
keymanNext.compareDocumentPosition(affiliate) & Node.DOCUMENT_POSITION_FOLLOWING,
evaluation.compareDocumentPosition(keymanNext) & Node.DOCUMENT_POSITION_FOLLOWING,
).not.toBe(0);
expect(keymanNext.compareDocumentPosition(related) & Node.DOCUMENT_POSITION_FOLLOWING).not.toBe(
0,
);
expect(related.compareDocumentPosition(affiliate) & Node.DOCUMENT_POSITION_FOLLOWING).not.toBe(
0,
);
} finally {
HTMLElement.prototype.scrollIntoView = originalScrollIntoView;
}
Expand Down Expand Up @@ -2590,6 +2601,7 @@ describe("App, authenticated", () => {
expect(await screen.findByRole("status", { name: "Keyman next action" })).toHaveTextContent(
"Ada West is the first Keyman. Read that person next.",
);
expect(await screen.findByRole("heading", { name: "Related to Ada West" })).toBeInTheDocument();
});

it("lets post_admin rebuild the period report", async () => {
Expand Down
237 changes: 135 additions & 102 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ function KeymanPanel({
focusPerson,
focusEntity,
focusTeam,
landFirstKeyman,
afterList,
}: {
postId: string;
accessToken: string;
Expand All @@ -573,6 +575,8 @@ function KeymanPanel({
focusPerson?: { personId: string; personName: string } | null;
focusEntity?: { entityId: string; entityName: string } | null;
focusTeam?: { teamId: string; teamName: string } | null;
landFirstKeyman?: boolean;
afterList?: ReactNode;
}) {
const [related, setRelated] = useState<RelatedNode[] | null>(null);
const [selectedName, setSelectedName] = useState<string | null>(null);
Expand Down Expand Up @@ -622,6 +626,23 @@ function KeymanPanel({
}
}

useEffect(() => {
if (!landFirstKeyman || selectedName || !keymen?.[0]) {
return;
}
const first = keymen[0];
const requestId = ++relatedRequest.current;
setSelectedName(first.person_name);
setRelated(null);
fetchRelatedKeymen(accessToken, first.person_id)
.then((result) => {
if (requestId === relatedRequest.current) setRelated(result.related);
})
.catch(() => {
if (requestId === relatedRequest.current) setRelated([]);
});
}, [accessToken, landFirstKeyman, keymen, selectedName]);

useEffect(() => {
if (!focusPerson) return;
const requestId = ++relatedRequest.current;
Expand Down Expand Up @@ -680,7 +701,86 @@ function KeymanPanel({
}
}

const relatedBlock = selectedName ? (
<div className="related-keymen">
<h4>Related to {selectedName}</h4>
{related === null ? (
<p>Loading related nodes...</p>
) : related.length === 0 ? (
<p className="popup-placeholder">No related nodes in the visible graph.</p>
) : (
<ul>
{related.map((node) => {
const caption = relatedNodeCaption(node);
const key = `${node.node_type_code}:${node.node_id}`;
if (!isKnownRelatedNodeType(node.node_type_code)) {
return <li key={key}>{caption}</li>;
}
switch (node.node_type_code) {
case NODE_POST:
if (!onSelectPost) {
return <li key={key}>{caption}</li>;
}
return (
<li key={key}>
<button
className="keyman-select"
aria-label={`Open related post: ${node.label ?? node.node_id}`}
onClick={() => onSelectPost(node.node_id)}
>
{caption}
</button>
</li>
);
case NODE_PERSON:
return (
<li key={key}>
<button
className="keyman-select"
aria-label={`Related nodes for ${caption}`}
onClick={() => handleSelect(node.node_id, node.label ?? node.node_id)}
>
{caption}
</button>
</li>
);
case NODE_CORPORATE_ENTITY:
return (
<li key={key}>
<button
className="keyman-select"
aria-label={`Related nodes for ${node.label ?? node.node_id}`}
onClick={() => handleSelectEntity(node.node_id, node.label ?? node.node_id)}
>
{caption}
</button>
</li>
);
case NODE_TEAM:
return (
<li key={key}>
<button
className="keyman-select"
aria-label={`Related nodes for ${node.label ?? node.node_id}`}
onClick={() => handleSelectTeam(node.node_id, node.label ?? node.node_id)}
>
{caption}
</button>
</li>
);
default: {
const _exhaustive: never = node.node_type_code;
return <li key={key}>{_exhaustive}</li>;
}
}
})}
</ul>
)}
</div>
) : null;

return (
<>
<section className="popup-section">
<div className="lineage-home-header">
<h3>Keyman</h3>
Expand All @@ -698,6 +798,9 @@ function KeymanPanel({
<button
className="keyman-select"
aria-label={`Related nodes for ${person.person_name}`}
aria-current={
landFirstKeyman && selectedName === person.person_name ? "true" : undefined
}
onClick={() => handleSelect(person.person_id, person.person_name)}
>
<strong>{person.person_name}</strong> ({person.person_side_label ?? person.person_side_code})
Expand Down Expand Up @@ -740,84 +843,11 @@ function KeymanPanel({
) : (
<p className="popup-placeholder">No Keyman extracted yet.</p>
)}
{selectedName && (
<div className="related-keymen">
<h4>Related to {selectedName}</h4>
{related === null ? (
<p>Loading related nodes...</p>
) : related.length === 0 ? (
<p className="popup-placeholder">No related nodes in the visible graph.</p>
) : (
<ul>
{related.map((node) => {
const caption = relatedNodeCaption(node);
const key = `${node.node_type_code}:${node.node_id}`;
if (!isKnownRelatedNodeType(node.node_type_code)) {
return <li key={key}>{caption}</li>;
}
switch (node.node_type_code) {
case NODE_POST:
if (!onSelectPost) {
return <li key={key}>{caption}</li>;
}
return (
<li key={key}>
<button
className="keyman-select"
aria-label={`Open related post: ${node.label ?? node.node_id}`}
onClick={() => onSelectPost(node.node_id)}
>
{caption}
</button>
</li>
);
case NODE_PERSON:
return (
<li key={key}>
<button
className="keyman-select"
aria-label={`Related nodes for ${caption}`}
onClick={() => handleSelect(node.node_id, node.label ?? node.node_id)}
>
{caption}
</button>
</li>
);
case NODE_CORPORATE_ENTITY:
return (
<li key={key}>
<button
className="keyman-select"
aria-label={`Related nodes for ${node.label ?? node.node_id}`}
onClick={() => handleSelectEntity(node.node_id, node.label ?? node.node_id)}
>
{caption}
</button>
</li>
);
case NODE_TEAM:
return (
<li key={key}>
<button
className="keyman-select"
aria-label={`Related nodes for ${node.label ?? node.node_id}`}
onClick={() => handleSelectTeam(node.node_id, node.label ?? node.node_id)}
>
{caption}
</button>
</li>
);
default: {
const _exhaustive: never = node.node_type_code;
return <li key={key}>{_exhaustive}</li>;
}
}
})}
</ul>
)}
</div>
)}
{!afterList && relatedBlock}
</section>
{afterList}
{afterList && relatedBlock}
</>
);
}

Expand Down Expand Up @@ -1415,31 +1445,34 @@ function PostDetailPopup({
</section>

{focusEventLineage && (
<>
<KeymanPanel
postId={postId}
accessToken={accessToken}
keymen={keymen}
canExtract={canExtract}
onExtracted={reloadKeymen}
onSelectPost={onSelectPost}
focusPerson={focusPerson}
focusEntity={focusEntity}
focusTeam={focusTeam}
/>
<EvaluationPanel
postId={postId}
accessToken={accessToken}
responses={evaluation}
canExtract={canExtract}
onEvaluated={(rows) => setEvaluation(rows)}
/>
{keymen?.[0] ? (
<p className="post-meta" role="status" aria-label="Keyman next action">
{firstKeymanNextAction(keymen[0].person_name)}
</p>
) : null}
</>
<KeymanPanel
postId={postId}
accessToken={accessToken}
keymen={keymen}
canExtract={canExtract}
onExtracted={reloadKeymen}
onSelectPost={onSelectPost}
focusPerson={focusPerson}
focusEntity={focusEntity}
focusTeam={focusTeam}
landFirstKeyman
afterList={
<>
<EvaluationPanel
postId={postId}
accessToken={accessToken}
responses={evaluation}
canExtract={canExtract}
onEvaluated={(rows) => setEvaluation(rows)}
/>
{keymen?.[0] ? (
<p className="post-meta" role="status" aria-label="Keyman next action">
{firstKeymanNextAction(keymen[0].person_name)}
</p>
) : null}
</>
}
/>
)}

<section className="popup-section">
Expand Down
2 changes: 1 addition & 1 deletion lineageweave/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
"sentence_excerpts",
]

__version__ = "1.7.0"
__version__ = "1.8.0"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lineageweave"
version = "1.7.0"
version = "1.8.0"
description = "Reconstructs git-branch-style lineage DAGs from scattered short records using multi-channel score fusion and LLM adjudication."
readme = "README.md"
license = { text = "MIT" }
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.