Skip to content

✨ Customers: graph view, merge and split, and export - #18802

Merged
kubestellar-prow[bot] merged 4 commits into
v5from
feat/customers-graphview
Nov 17, 2026
Merged

kubestellar-prow[bot] merged 4 commits into
v5from
feat/customers-graphview

Conversation

@clubanderson

Copy link
Copy Markdown
Member

PR 8 of the Customers series (RFC #18742). Independent of PR 7 (#18794).

What is here

  • Graph view: a Show graph button on a profile draws the person in the middle, the things they touched on a ring, and the other people on those things on an outer ring. Clicking another person opens their profile. It is one GraphQL query (a person's edges and, under each, the people on that artefact; depth 7 of the allowed 8), so the viewer rules of the graph endpoint apply unchanged: a read-only user's graph holds only themselves.
  • Merge / unmerge / split (owner and read-write):
    • Merge folds a customer into another and moves every activity edge across. The merge is recorded on the target with the source as it stood.
    • Unmerge gives back exactly what the merge brought, and moves back only the edges whose via identity belonged to the restored person; activity the target produced on its own stays.
    • Split moves chosen identities, and the edges they produced, to a new customer. A hive_user identity cannot be split off, a split must leave an identity behind, and two dashboard users cannot be merged.
  • Export (owner only): the profile (with notes, satisfaction and merge history), open hints and up to 10,000 activity references, as a JSON download.
  • Four routes: POST /api/customers/{id}/merge, /unmerge, /split, and GET /api/customers/{id}/export, in openapi and the API reference. Audited as customer_merge, customer_unmerge, customer_split, customer_export; ids copied into the audit line are cleaned and bounded.

Access (tests walk every role)

A read-only user can use none of these routes, on anyone, themselves included (TestMergeSplitExportRoles, TestCustomersRoleMatrix). Read-write cannot export. The page hides what a role cannot use, and the server refuses it anyway.

Departure from the plan

The plan said to share the canvas layout from js/knowledge.js. I did not: that canvas is animated, drawn with inline styles that the style ratchet only tolerates because they are baselined, and is built for a thousand-node force layout. The customers view is a small static radial drawing in a new file (js/graphcanvas.js) that follows the page's design tokens, adds no inline styles and no raw colours, and stays readable on a phone. The layout and the SVG are tested under node (bounded, deduplicated, escaped, no NaN).

Tests

Edge moves through merge, undo and split (TestMergeUnmergeSplitMoveEdgesExactly); export (TestExport); handler bodies and audit (TestCustomersMergeSplitExportBodiesAndAudit); the render helpers as owner, read-write and read-only, and the graph layout (TestCustomersViewGates).

Refs #18742

🤖 Generated with Claude Code

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18800 ✨ Dashboard/API: set review.perspectives_source and agent sandbox image/block without editing config files same files src/pkg/dashboard/static-src/manifest.txt
src/pkg/dashboard/static/index.html
#18778 ✨ Governor PRs by model: rework per backend and a per-effort breakdown same files src/pkg/dashboard/static/index.html
#18808 ✨ Calendar: Inbox-style layout, clearer date line, approval reason same files src/pkg/dashboard/static/index.html
#18781 ✨ Spend and contributor run stats by model: add the canonical model name same files dashboard/openapi.json
src/pkg/dashboard/static/index.html
#18782 ✨ Governor PRs by model: split closed-unmerged PRs into superseded, duplicate and other same files src/pkg/dashboard/static/index.html
#18784 ✨ Contributor run stats by model: why runs failed (scenario split, abandoned, failure kinds) same files dashboard/openapi.json
#18779 ✨ Governor PRs by model: per-repository breakdown and weekly trend same files src/pkg/dashboard/static/index.html
#18785 ✨ PRs by model: list one model's pull requests same files src/pkg/dashboard/static/index.html
#18780 ✨ Governor PRs by model: what each model's PRs cost the hive to review same files src/pkg/dashboard/static/index.html
#18786 🐛 Claude model dropdown and price table: add Fable 5.2, Fable 5.1, Haiku 5.5 and the fable alias same files src/pkg/dashboard/static/index.html
#18783 ✨ Evidence summary: change failures (reverts, reopened issues) per model same files dashboard/openapi.json
src/pkg/dashboard/static/index.html

PR 8 of RFC #18742.

- A profile Graph: the person, their artefacts and the other people on them,
  an SVG drawn from one GraphQL query.
- Merge, unmerge and split with exact edge moves by the identity that
  produced them; two dashboard users never merge; a hive user identity never
  splits off. Full view only, audited.
- Export for the owner: profile, merge history, hints and up to 10,000 edge
  references. Audited.
- Four routes in openapi and the API reference.

Refs #18742

Signed-off-by: Andy Anderson <andy@clubanderson.com>
TestNoForcedBrowserDownloadsRatchet forbids createObjectURL and a.download.

Refs #18742

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Refs #18742

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Refs #18742

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 1 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.

File Line Mutation
src/pkg/customers/service.go 557 CONDITIONALS_BOUNDARY

2 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the mutation/acknowledged label to accept this.

File Line Mutation
src/cmd/hive/customerswire.go 228 CONDITIONALS_NEGATION
src/pkg/customers/service.go 473 CONDITIONALS_NEGATION

Verdict: lived (#17349).

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
kubestellar-prow Bot merged commit 129856d into v5 Nov 17, 2026
96 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/customers-graphview branch November 17, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant