Capture fixture: run card graph maps, pipeline graph under graph=1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
// The graph maps the `shown=2` run cards carry (ChatShownRunMap): a release
|
||||
// running its second review after one round of changes, a feature that failed
|
||||
// its tests, and a docs run that succeeded.
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
|
||||
JsonMap _stage(
|
||||
String key,
|
||||
Map<String, String> edges, {
|
||||
int visits = 0,
|
||||
String status = '',
|
||||
int seconds = 0,
|
||||
int? runningSince,
|
||||
bool fallbackError = false,
|
||||
}) => {
|
||||
'key': key,
|
||||
'type': 'model',
|
||||
'edges': edges,
|
||||
if (fallbackError) 'fallback_error': true,
|
||||
if (visits > 0) 'visits': visits,
|
||||
if (status.isNotEmpty) 'status': status,
|
||||
if (seconds > 0) 'seconds': seconds,
|
||||
'running_since': ?runningSince,
|
||||
};
|
||||
|
||||
JsonMap _visit(
|
||||
int sequence,
|
||||
String stage,
|
||||
String status, [
|
||||
String outcome = '',
|
||||
String target = '',
|
||||
]) => {
|
||||
'sequence': sequence,
|
||||
'stage': stage,
|
||||
'status': status,
|
||||
'outcome': outcome,
|
||||
'target': target,
|
||||
};
|
||||
|
||||
/// plan → implement → review, review sending changes back to implement.
|
||||
JsonMap releaseRunningMap(int reviewSince) => {
|
||||
'stages': [
|
||||
_stage(
|
||||
'plan',
|
||||
{'success': 'implement'},
|
||||
visits: 1,
|
||||
status: 'completed',
|
||||
seconds: 84,
|
||||
),
|
||||
_stage(
|
||||
'implement',
|
||||
{'success': 'review'},
|
||||
visits: 2,
|
||||
status: 'completed',
|
||||
seconds: 431,
|
||||
fallbackError: true,
|
||||
),
|
||||
_stage(
|
||||
'review',
|
||||
{'success': 'publish', 'changes': 'implement'},
|
||||
visits: 2,
|
||||
status: 'running',
|
||||
seconds: 95,
|
||||
runningSince: reviewSince,
|
||||
),
|
||||
_stage('publish', {'success': '#'}),
|
||||
],
|
||||
'visits': [
|
||||
_visit(1, 'plan', 'completed', 'success', 'implement'),
|
||||
_visit(3, 'review', 'completed', 'changes', 'implement'),
|
||||
_visit(4, 'implement', 'completed', 'success', 'review'),
|
||||
_visit(5, 'review', 'running'),
|
||||
],
|
||||
};
|
||||
|
||||
/// plan → implement → test, the tests failing into the failure end.
|
||||
JsonMap featureFailedMap() => {
|
||||
'stages': [
|
||||
_stage(
|
||||
'plan',
|
||||
{'success': 'implement'},
|
||||
visits: 1,
|
||||
status: 'completed',
|
||||
seconds: 62,
|
||||
),
|
||||
_stage(
|
||||
'implement',
|
||||
{'success': 'test'},
|
||||
visits: 1,
|
||||
status: 'completed',
|
||||
seconds: 318,
|
||||
),
|
||||
_stage(
|
||||
'test',
|
||||
{'success': '#', 'tests_failed': '#failure'},
|
||||
visits: 1,
|
||||
status: 'failed',
|
||||
seconds: 190,
|
||||
),
|
||||
],
|
||||
'visits': [
|
||||
_visit(1, 'plan', 'completed', 'success', 'implement'),
|
||||
_visit(2, 'implement', 'completed', 'success', 'test'),
|
||||
_visit(3, 'test', 'failed', 'tests_failed', '#failure'),
|
||||
],
|
||||
};
|
||||
|
||||
/// draft → check → publish, all passed.
|
||||
JsonMap docsSucceededMap() => {
|
||||
'stages': [
|
||||
_stage(
|
||||
'draft',
|
||||
{'success': 'check'},
|
||||
visits: 1,
|
||||
status: 'completed',
|
||||
seconds: 141,
|
||||
),
|
||||
_stage(
|
||||
'check',
|
||||
{'success': 'publish', 'fix': 'draft'},
|
||||
visits: 1,
|
||||
status: 'completed',
|
||||
seconds: 22,
|
||||
),
|
||||
_stage(
|
||||
'publish',
|
||||
{'success': '#'},
|
||||
visits: 1,
|
||||
status: 'completed',
|
||||
seconds: 9,
|
||||
),
|
||||
],
|
||||
'visits': [
|
||||
_visit(1, 'draft', 'completed', 'success', 'check'),
|
||||
_visit(2, 'check', 'completed', 'success', 'publish'),
|
||||
_visit(3, 'publish', 'completed', 'success', '#'),
|
||||
],
|
||||
};
|
||||
@@ -1,11 +1,13 @@
|
||||
// `?shown=2` (with `?chats=N×tamps=1&files=1`): the subscribe reply
|
||||
// carries the newer shown entries instead of the `shown=1` set, after the
|
||||
// bench transcript's last answer: a dark-aware and a light-only HTML view, a
|
||||
// run card running and one finished, a file changed since it was shown, an
|
||||
// image that no longer exists, a web image the server fetched, and a diff of
|
||||
// a revision limited to some paths.
|
||||
// bench transcript's last answer: a dark-aware and a light-only HTML view,
|
||||
// run cards running, failed and succeeded (each with its graph map), a file
|
||||
// changed since it was shown, an image that no longer exists, a web image the
|
||||
// server fetched, and a diff of a revision limited to some paths.
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
|
||||
import 'chat_shown_run_map_fixture.dart';
|
||||
|
||||
int _at(int minute, int second) =>
|
||||
DateTime.utc(2026, 11, 5, 9, minute, second).millisecondsSinceEpoch;
|
||||
|
||||
@@ -70,6 +72,7 @@ JsonMap chatShownToolsFixture(Object? sessionId) => {
|
||||
'status': 'running',
|
||||
'current_stage': 'review',
|
||||
'started_at': _now - 754000,
|
||||
'map': releaseRunningMap(_now - 40000),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -84,6 +87,22 @@ JsonMap chatShownToolsFixture(Object? sessionId) => {
|
||||
'outcome': 'tests_failed',
|
||||
'started_at': _at(1, 0),
|
||||
'finished_at': _at(9, 30),
|
||||
'map': featureFailedMap(),
|
||||
},
|
||||
},
|
||||
{
|
||||
'id': 'shown-run-ok',
|
||||
'kind': 'run',
|
||||
'created_at': _at(19, 27),
|
||||
'run': {
|
||||
'id': 5,
|
||||
'pipeline': 'Docs',
|
||||
'title': 'Refresh the install guide',
|
||||
'status': 'succeeded',
|
||||
'outcome': 'success',
|
||||
'started_at': _at(10, 0),
|
||||
'finished_at': _at(12, 52),
|
||||
'map': docsSucceededMap(),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -343,6 +343,7 @@ JsonMap probePipelineDetail(int id, int requestedVersion) {
|
||||
'version_created_at': '2026-10-18T16:05:00',
|
||||
'content_hash': 'sha256:probe-$id-v$version',
|
||||
'source': _releaseSource,
|
||||
if (perfRunGraph) 'graph': perfRunGraphFixture(),
|
||||
'versions': [
|
||||
for (var v = 1; v <= latest; v++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user