Artifacts: runner-internal turn files move to a Debugging files group

Each recorded artifact now carries a server group (deliverable or debug).
public/ files are deliverables; input/memory/history/output.md, session
exports and private/ scratch are debugging files. The app's Artifacts tab
lists deliverables and the Debug toggle reveals a separate Debugging files
group (older servers fall back to the filename rule); the TUI lists
deliverables first and marks debug rows; artifact search excludes debug
files unless include_debug / --debug-files is set.
This commit is contained in:
2026-11-04 17:43:47 +00:00
parent b5927505cc
commit 57f5219628
24 changed files with 541 additions and 30 deletions
@@ -8,6 +8,10 @@ import '../domain/artifact_groups.dart';
import 'artifact_record_row.dart';
import 'artifact_row_labels.dart';
/// The gallery's label for a visit's runner-internal files (turn documents,
/// history.md, private/ scratch, session exports), shown only while Debug is on.
const String debuggingFilesTitle = 'Debugging files';
/// One visit's turn documents, shown below its stage artifacts.
///
/// A recorded document is a normal gallery row with its recorded name, MIME and
@@ -21,8 +25,13 @@ class ArtifactDocumentSection extends StatelessWidget {
this.selectedIdentity,
this.onSelected,
this.showHeader = true,
this.title = 'Turn documents',
});
/// The section label: the Session page names the turn documents; the gallery
/// names every runner-internal file it lists as debugging files.
final String title;
/// False when a collapsible title above already names the section.
final bool showHeader;
@@ -54,7 +63,7 @@ class ArtifactDocumentSection extends StatelessWidget {
container: true,
header: true,
child: Text(
'Turn documents',
title,
style: cupertino ? SectionHeadingStyle.of(context).title : null,
),
),
@@ -124,7 +124,7 @@ class _ArtifactGalleryPageState extends State<ArtifactGalleryPage> {
for (final document in group.documents) {
final record = document.record;
if (record == null || record.url != url) continue;
// A turn document is listed only while the debug toggle shows them.
// A debugging file is listed only while the debug toggle shows them.
_showTurnDocuments = true;
_opening = (group: group, artifact: record);
}
@@ -556,7 +556,7 @@ class _ArtifactGalleryPageState extends State<ArtifactGalleryPage> {
Widget _debugToggle(BuildContext context) {
final showing = _showTurnDocuments;
final label = showing ? 'Hide turn documents' : 'Show turn documents';
final label = showing ? 'Hide debugging files' : 'Show debugging files';
// Cupertino's bundled icon font has no bug glyph; retain the universally
// recognisable Material bug icon inside its native Cupertino button.
final icon = showing ? Icons.bug_report : Icons.bug_report_outlined;
@@ -211,7 +211,7 @@ class _ArtifactVisitListState extends State<ArtifactVisitList> {
group: group,
selectedIdentity: widget.selectedIdentity,
onSelected: widget.onSelected,
showHeader: false,
title: debuggingFilesTitle,
),
),
),