feat(craft): outputs artifact classifier - #14326
Open
nmgarza5 wants to merge 2 commits into
Open
Conversation
Contributor
Greptile SummaryAdds pure classification functions that convert complete sandbox output listings into deterministic artifact records.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Complete outputs listing] --> B[Remove hidden paths]
B --> C[Group entries by top-level root]
C --> D{Top-level entry type}
D -->|File| E[Classify extension or MIME family]
D -->|Directory| F[Aggregate visible descendants]
F --> G{web/package.json present?}
G -->|Yes| H[WEB_APP artifact]
G -->|No| I[DIRECTORY artifact]
E --> J[Sort artifacts by path]
H --> J
I --> J
Reviews (2): Last reviewed commit: "docs(craft): state the partial-metadata ..." | Re-trigger Greptile |
Contributor
Author
2 tasks
nmgarza5
force-pushed
the
nikg/craft-artifact-classifier
branch
from
August 27, 2026 18:56
178110b to
2735d38
Compare
Contributor
|
Full-stack Preview (frontend + backend)
|
Contributor
🖼️ Visual Regression Report
|
Pure functions from an outputs listing to the artifacts a reconciler should hold: each visible top-level entry is one artifact, files typed by extension with a generic fallback, directories aggregating visible descendants into a deterministic content hash, and the scaffolded web directory recognized as a webapp. Files past the manifest hash ceiling carry a size-and-mtime surrogate so change detection still moves for them. The shared hidden-name rule moves to configs so the classifier and the session manager filter identically without the classifier importing the manager, and the webapp path convention gains derived constants in nextjs_dev so its consumers cannot drift.
An adapter that omits size or mtime for an unhashed file degrades change detection to the field it did supply. The docstring says so and a test pins the degradation, since no metadata-only signal can see a change in data it was never given.
nmgarza5
force-pushed
the
nikg/craft-artifact-classifier
branch
from
August 27, 2026 21:37
2735d38 to
7c972f3
Compare
nmgarza5
had a problem deploying
to
ci-protected
August 27, 2026 21:38 — with
GitHub Actions
Failure
rohoswagger
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Why. Between the manifest (#14325, what exists in outputs/) and the artifact rows (#14319, what the panel renders) sits a decision: which entries are deliverables, what type each one is, and what hash a directory gets so version bumps fire exactly when content changes. The only classification in the codebase today is the fabricated webapp check (
web/directory exists, no package.json required). This PR makes that decision a set of pure, unit-testable functions so the reconciler (#14327) stays a thin diff loop. Stacked on #14319 because the classifier emits the widenedArtifactTypevalues.What.
artifact_classifier.py:derive_artifactsreduces an outputs listing to its artifacts — each visible top-level entry is one artifact, nested files belong to their top-level directory and never surface on their own. Files are typed by extension with a generic fallback (.tsis pinned to CODE before the mimetypes families, which register it as video/mp2t). The scaffolded webapp is recognized by the sameweb/package.jsonconvention the runtime uses.node_modules,.next, dotfiles) never influence the result, so build churn cannot dirty an artifact.meta:<size>:<mtime>surrogate signal. Passing NULL instead would mean the version never bumps for large files, because feat(craft): artifact index and action receipt schema with DAL #14319's upsert compares withIS DISTINCT FROMand NULL never differs from NULL.configs.pyso the classifier and the session manager filter identically without the classifier importing the manager, and the webapp path constants unify innextjs_dev.pyso the convention cannot drift across its three consumers.Nothing consumes
derive_artifactsyet; the reconciler in #14327 does.How Has This Been Tested?
test_artifact_classifier.py): the full extension table including the.ts/mimetypes pitfall and legacy binary formats staying generic, top-level-only reduction, deep-nesting aggregation, directory hashes moving on content change/rename/add and not on hidden churn, identical trees hashing identically, hidden-only directories hashing like empty ones, the exact webapp convention (nestedweb/and package.json-as-directory both rejected), surrogate behavior for unhashed files including partial-metadata degradation, and sort determinism.Additional Options