Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7adfbe3
feat(dashboard): add processing, usage, and runtime observability
happy-v587 Oct 31, 2026
bd226dc
feat(dashboard): add cloud-native monitoring guide and restructure Dr…
happy-v587 Nov 9, 2026
8a633f8
chore: retrigger CI
happy-v587 Nov 9, 2026
9476bed
chore: retrigger CI
happy-v587 Nov 9, 2026
be4bec4
chore: sync PR head
happy-v587 Nov 9, 2026
5fd5312
chore: retrigger CI
happy-v587 Nov 10, 2026
e9ff41d
feat(dashboard): show source save time
happy-v587 Nov 10, 2026
38ee86a
fix(ci): restore integration contracts and pin ACP runner SDK
happy-v587 Nov 10, 2026
0965f70
fix(ci): review source save metadata compatibility
happy-v587 Nov 10, 2026
706faed
test(persistence): expect unknown save time for legacy sources
happy-v587 Nov 10, 2026
e27fca3
fix(desktop): qualify current dashboard server contract
happy-v587 Nov 10, 2026
6e7c579
fix(dashboard): preserve source preview metadata and attribution
happy-v587 Nov 10, 2026
9608296
test(handoff): isolate report query budget from background SQL
happy-v587 Nov 10, 2026
e7bd019
test(dsh): install compatible plugin in web doctor fixture
happy-v587 Nov 10, 2026
2e5b3ba
fix(dashboard): preserve exact source navigation
happy-v587 Nov 11, 2026
ea7b073
fix(topic-memory): bound related history candidates
happy-v587 Nov 12, 2026
f94a655
fix(rebase): reconcile migration manifests and upgrade review
happy-v587 Nov 12, 2026
3be6c00
chore(rebase): regenerate API models
happy-v587 Nov 12, 2026
3e32757
fix(ci): add missing license headers to dashboard templates
happy-v587 Nov 12, 2026
90ea28a
test(e2e): rewind registered schema by the whole pending chain
happy-v587 Nov 12, 2026
7408253
chore: retrigger CI
happy-v587 Nov 12, 2026
bd54aff
fix(desktop): requalify the merged Dashboard contract
happy-v587 Nov 12, 2026
c1ca71c
fix(dashboard): prefill the saved feedback reason when editing
happy-v587 Nov 12, 2026
c749213
fix(dashboard): keep failure navigation consistent with its summary
happy-v587 Nov 13, 2026
c328f92
fix(desktop): requalify the Dashboard contract on SQLite
happy-v587 Nov 13, 2026
685f4ad
fix(release): review the status-filtered processing read
happy-v587 Nov 13, 2026
4e12b39
fix(integrations): rebuild bundles for the all-history summary
happy-v587 Nov 13, 2026
5cf73ec
test(native): wait out launchd's respawn throttle in the retry test
happy-v587 Nov 13, 2026
b2be0b6
refactor(dashboard): remove ledgers and show source artifacts
happy-v587 Nov 13, 2026
8596ad4
fix(dashboard): complete source lineage views and remove stale ledger…
happy-v587 Nov 13, 2026
a377df7
refactor: separate topic memory history fix
happy-v587 Nov 13, 2026
f56630c
merge: synchronize dashboard with master
happy-v587 Nov 13, 2026
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
Prev Previous commit
Next Next commit
fix(dashboard): preserve exact source navigation
  • Loading branch information
happy-v587 committed Nov 12, 2026
commit 2e5b3baf63835a57a1fc3b3d734e736ae438b765
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h1 class="page-title mb-3">{{ t.get('processing_operation_' ~ run.operation,run
{% if run.target %}{% set destination = artifact_destination(run.target) %}<div class="processing-document"><strong>{{ t.processing_target }}</strong><div class="processing-reference">{% if destination %}<a href="{{ destination }}">{{ run.target.family }}/{{ run.target.artifact_id }}@{{ run.target.revision }}</a>{% else %}{{ run.target.family }}/{{ run.target.artifact_id }}@{{ run.target.revision }}{% endif %}</div></div>{% endif %}
{% if manifest %}
{% for ref in manifest.artifacts if ref != run.target %}{% set destination = artifact_destination(ref) %}<div class="processing-document processing-reference">{% if destination %}<a href="{{ destination }}">{{ t.get(ref.family,ref.family) }} · {{ ref.artifact_id }}@{{ ref.revision }}</a>{% else %}{{ ref.family }}/{{ ref.artifact_id }}@{{ ref.revision }}{% endif %}</div>{% endfor %}
{% for source in processing_run_sources %}<div class="processing-document processing-reference">{{ source.source_type }}/{{ source.source_id }}{% if source.source_type == 'content' %} <a href="{{ link(record_type='sources',source_id=source.source_id,run_id=none) }}">{{ t.source_original }} →</a>{% endif %}</div>{% endfor %}
{% for source in processing_run_sources %}<div class="processing-document processing-reference">{{ source.source_type }}/{{ source.source_id }}{% if source.source_type == 'content' %} <a href="{{ link(record_type='sources',run_status=none,processing_day=none,source_id=source.source_id,run_id=none) }}">{{ t.source_original }} →</a>{% endif %}</div>{% endfor %}
{% endif %}
<p class="mt-3">{{ t.processing_inputs_scope }}</p>
<p class="mb-0">{{ t.processing_attempts_scope }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h2 class="visually-hidden">{{ t.note_version_record }}</h2>
{% if meta.value and meta.value.reason %}<p>{{ meta.value.reason }}</p>{% elif item.get('creation') and item.creation.type == 'merge' %}<p>{{ t.note_merge_record }}</p>{% elif publication.found %}<p>{{ t.note_processing_publication }}</p>{% else %}<p class="small text-secondary mb-0">{{ t.note_reason_unrecorded }}</p>{% endif %}
</section>
<details class="supporting-details" aria-label="{{ t.note_direct_sources }}"><summary>{{ t.source_references_short }} <span class="text-secondary ms-2">{{ item.sources|length }}</span></summary>
{% for source in item.sources %}<div class="mb-3"><div class="document-meta mb-2">{{ t.source_label }} {{ loop.index }}</div>{% if source.source_type == 'content' %}{% set chosen=namespace(index=0) %}{% for readable in related_sources if readable.source_id == source.source_id %}{% set chosen.index=loop.index0 %}{% endfor %}{{ evidence_link(chosen.index,t.source_original) }}{% if not record_only %}<a class="ms-3" href="{{ link('processing',record_type='sources',source_id=source.source_id) }}">{{ t.note_processing_link }} →</a>{% endif %}{% else %}<p class="small text-secondary">{{ t.note_source_reference_only }}</p>{% endif %}<details class="mt-2 small"><summary>{{ t.note_record_identity }}</summary><code>{{ source.source_type }}/{{ source.source_id }}</code></details></div>{% else %}<p class="text-secondary">{{ t.note_sources_empty }}</p>{% endfor %}
{% for source in item.sources %}<div class="mb-3"><div class="document-meta mb-2">{{ t.source_label }} {{ loop.index }}</div>{% if source.source_type == 'content' %}{% set chosen=namespace(index=0) %}{% for readable in related_sources %}{% if readable.source_type == source.source_type and readable.source_id == source.source_id %}{% set chosen.index=loop.index0 %}{% endif %}{% endfor %}{{ evidence_link(chosen.index,t.source_original) }}{% if not record_only %}<a class="ms-3" href="{{ link('processing',record_type='sources',source_id=source.source_id) }}">{{ t.note_processing_link }} →</a>{% endif %}{% else %}<p class="small text-secondary">{{ t.note_source_reference_only }}</p>{% endif %}<details class="mt-2 small"><summary>{{ t.note_record_identity }}</summary><code>{{ source.source_type }}/{{ source.source_id }}</code></details></div>{% else %}<p class="text-secondary">{{ t.note_sources_empty }}</p>{% endfor %}
<p class="small text-secondary mb-0">{{ t.note_sources_scope }}</p>
</details>
{% if (note_processing and note_processing['items']) or errors.get('note_processing') %}<details class="supporting-details"><summary>{{ t.processing_related_history }}</summary>{% if errors.get('note_processing') %}{{ read_error(errors.note_processing,t.processing_related_history) }}{% else %}<p class="small text-secondary">{{ t.processing_related_scope }}</p>{% for record in note_processing['items'] %}<div class="mb-3"><p class="small text-secondary mb-2">{{ t['processing_attempt_' ~ record.status] }} · {{ record.completed_at or record.started_at }}</p>{% for source in record.sources if source.source_type == 'content' %}<a class="d-block mb-2" href="{{ link('processing',record_type='sources',source_id=source.source_id) }}">{{ t.note_processing_link }} →</a>{% endfor %}</div>{% endfor %}{% if note_processing.next_cursor %}<p class="small text-secondary">{{ t.processing_related_limit }}</p>{% endif %}{% endif %}</details>{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<section class="processing-history-row">
<h4 class="processing-history-label"><span class="processing-step-number">1</span>{{ t.processing_history_input }}</h4>
<div class="processing-history-content">
{% for source in item.source_previews %}<div class="mb-3">{% if source.preview is not none %}<p class="processing-input-body">{{ source.preview|truncate(200,true) }}</p>{% else %}<p class="text-secondary">{{ t.processing_attempt_source_unavailable }}</p>{% endif %}{% if source.source_type == 'content' %}<a href="{{ link(record_type='sources',source_id=source.source_id,processing_attempts_cursor=none) }}">{{ t.processing_attempt_source_detail }} →</a>{% endif %}</div>{% else %}<p class="text-secondary mb-0">{{ t.processing_inputs_unknown }}</p>{% endfor %}
{% for source in item.source_previews %}<div class="mb-3">{% if source.preview is not none %}<p class="processing-input-body">{{ source.preview|truncate(200,true) }}</p>{% else %}<p class="text-secondary">{{ t.processing_attempt_source_unavailable }}</p>{% endif %}{% if source.source_type == 'content' %}<a href="{{ link(record_type='sources',run_status=none,processing_day=none,source_id=source.source_id,processing_attempts_cursor=none) }}">{{ t.processing_attempt_source_detail }} →</a>{% endif %}</div>{% else %}<p class="text-secondary mb-0">{{ t.processing_inputs_unknown }}</p>{% endfor %}
</div>
</section>
<section class="processing-history-row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="processing-table-input {{ 'mt-2' if not loop.first else '' }}">{% if preview and preview.title %}<strong>{{ preview.title|truncate(100,true) }}</strong>{% elif preview and preview.text %}{{ preview.text|truncate(140,true) }}{% else %}<span class="text-secondary">{{ t.get(ref.family, ref.family) }} · {{ t.revision }} {{ ref.revision }}</span>{% endif %}</div>
{% endif %}{% endfor %}
{% for source in sources %}{% if loop.index <= 2 %}
<div class="processing-table-input mt-2"><span class="text-secondary small">{{ t.source_label }} · {{ source.source_id|truncate(48,true) }}</span>{% if source.source_type == 'content' %} <a class="small" href="{{ link(record_type='sources', source_id=source.source_id, run_id=none) }}">{{ t.source_original }} →</a>{% endif %}</div>
<div class="processing-table-input mt-2"><span class="text-secondary small">{{ t.source_label }} · {{ source.source_id|truncate(48,true) }}</span>{% if source.source_type == 'content' %} <a class="small" href="{{ link(record_type='sources',run_status=none,processing_day=none, source_id=source.source_id, run_id=none) }}">{{ t.source_original }} →</a>{% endif %}</div>
{% endif %}{% endfor %}
{% set shown = [artifacts|length, 3]|min + [sources|length, 2]|min %}
{% if artifacts|length + sources|length > shown %}<p class="small text-secondary mt-2 mb-0">{{ t.processing_attempt_more_inputs.format(count=artifacts|length + sources|length - shown) }}</p>{% endif %}
Expand Down
98 changes: 97 additions & 1 deletion tests/test_dashboard_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,80 @@ def test_memory_source_reader_is_bound_to_exact_revision(dashboard, monkeypatch,
assert "Original note." not in crossed.text


@pytest.mark.parametrize("public_reads", [False, True])
def test_memory_source_buttons_open_each_recorded_source(tmp_path, monkeypatch, public_reads):
from powercontext.builtin.artifacts.atomic_memory.extraction import (
AtomicMemoryCandidate,
AtomicMemoryExtractionOutput,
)
from powercontext.builtin.inference import GenerationResult
from powercontext.builtin.runtime import CaptureSource
from powercontext.builtin.scope import ScopeDraft

class CombinedPipeline:
async def generate(self, request, /):
return GenerationResult(
output=AtomicMemoryExtractionOutput(
candidates=(
AtomicMemoryCandidate(
kind="fact",
text="Both sources support this fact.",
description="Combined source evidence",
evidence_ids=tuple(item.evidence_id for item in request.evidence),
),
)
)
)

async def scenario():
async with open_dream_runtime(
BuiltinConfig(database=SQLiteConfig(url=f"sqlite+aiosqlite:///{tmp_path}/buttons.db")),
candidate_pipeline=atomic_memory_pipeline(CombinedPipeline()),
) as runtime:
scope = (
await runtime.scopes.create(
ScopeDraft(title="Multiple source buttons", summary="Exact evidence", idempotency_key="buttons")
)
).scope_id
for index in range(2):
await runtime.sources.for_scope(scope).capture(
CaptureSource(source_id=f"source-{index}", content=f"Evidence body {index}.", metadata={})
)
await runtime.atomic_memory.for_scope(scope).flush()
memory = (await runtime.atomic_memory.for_scope(scope).list()).items[0]
app = create_app(application=runtime)
app.include_router(router, prefix="/dashboard")
if not public_reads:
app.state.dashboard_runtime = runtime
else:
monkeypatch.setattr("powercontext.server.dashboard.api._builtin_runtime", lambda request: None)
async with httpx.AsyncClient(
transport=httpx.ASGITransport(app=app), base_url="http://testserver"
) as client:
page = await client.get(
"/dashboard/notes",
params={
"scope": scope,
"artifact": memory.ref.artifact_id,
"revision": memory.ref.revision,
"lang": "en",
},
)
assert page.status_code == 200, page.text
direct = page.text.split('aria-label="Sources for this revision"', 1)[1]
direct = direct.split('<details class="supporting-details"', 1)[0]
buttons = re.findall(r'<a class="evidence-link" href="([^"]+)"', direct)
assert len(buttons) == 2
for index, button in enumerate(buttons):
destination = unescape(button)
assert urlsplit(destination).path == f"/dashboard/evidence/source-{index}"
evidence = await client.get(destination, headers={"HX-Request": "true"})
assert evidence.status_code == 200, evidence.text
assert f"Evidence body {index}." in evidence.text

asyncio.run(scenario())


def test_memory_source_login_returns_to_the_exact_memory(dashboard):
scope = create_scope(dashboard, "Memory evidence login")["scope_id"]
artifact = _revised_memory(dashboard, scope)
Expand Down Expand Up @@ -231,7 +305,9 @@ async def scenario():
) as runtime:
scope, source, citation = await seed(runtime)
accepted = await runtime.dream.for_scope(scope).create(
CreateDreamRunRequest(operation="refine_experience", artifacts=(citation,), idempotency_key="dashboard")
CreateDreamRunRequest(
operation="refine_experience", artifacts=(citation,), sources=(source,), idempotency_key="dashboard"
)
)
app = create_app(application=runtime)
app.include_router(router, prefix="/dashboard")
Expand Down Expand Up @@ -292,6 +368,26 @@ async def scenario():
assert filtered.status_code == 200, filtered.text
assert (run.run_id in filtered.text) == (outcome == "failed")
assert ("processing-runs-table" in filtered.text) == (outcome == "failed")
from datetime import UTC, datetime

for params in (
{"record_type": "attempts", "run_status": "succeeded"},
{"record_type": "attempts", "processing_day": datetime.now(UTC).date().isoformat()},
{"record_type": "dreams", "run_status": run.status},
{"record_type": "dreams", "run_status": run.status, "run_id": run.run_id},
):
selected = await client.get("/dashboard/processing", params={"scope": scope, **params})
assert selected.status_code == 200, selected.text
source_links = [
url
for url in links(selected.text, "/dashboard/processing")
if parse_qs(urlsplit(url).query).get("source_id") == [source.source_id]
]
assert source_links, params
for destination in source_links:
opened = await client.get(destination)
assert opened.status_code == 200, (destination, opened.text)
assert "Replayed the write with key K" in opened.text
if outcome == "failed":
assert LABELS["processing_table_inputs"] in filtered.text
assert LABELS["processing_operation_refine_experience"] in filtered.text
Expand Down