refactor(cli): simplify semantic validator and remove legacy commands - #285
Merged
Conversation
jrepp
force-pushed
the
docs/architecture-update
branch
2 times, most recently
from
June 21, 2026 00:34
2814586 to
dc21e2d
Compare
Retire CLI-only surface that duplicated runtime/automation paths now owned elsewhere: - Drop --import-stackimport-project and its --loose-media-*, --stack-library-json, --used-stack-aliases, --no-replace-existing-project-output options. Project import still runs through StackImportPackageProjectImporter (used by HypeDebugServer and HypeCore tests). - Drop --validate-package. SQLite package validation still runs through HypeSQLiteStackStore.validate(packageURL:) (used by TargetRuntimePackageBuilder and persistence tests). - Drop --parse-only flag (unused). - Simplify ScriptSemanticValidator: remove card-context flow analysis, static navigation target tracking, legacyCardId resolution, message-path function-handler lookups, and imported background/button/field pass-through hook exceptions. The validator now reports a conservative, context-free set of issues.
jrepp
force-pushed
the
refactor/cli-validator
branch
from
June 21, 2026 01:00
e85c729 to
a48be0d
Compare
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.
Summary
Retire legacy CLI-only surface that duplicated runtime/automation paths now owned elsewhere, and simplify
ScriptSemanticValidatorto a conservative, context-free set of checks. Net −1160 lines acrossHypeCLI.swiftandHypeCLITests.swift.Context
The CLI grew several diagnostic/import entrypoints that overlapped with capabilities already living in HypeCore and driven by the app/debug server. They were exercised only by CLI tests and added maintenance cost (and a tangle of
effectiveCardId/ message-path flow analysis in the semantic validator that produced noisy, hard-to-reason-about findings). This PR removes the dead CLI surface and simplifies the validator while preserving every runtime caller.Rebased onto
main(the prior basedocs/architecture-updatelanded as #284; those two commits dropped out of this branch during rebase, leaving a single clean commit).Changes Made
Removed CLI options (
Sources/HypeCLI/HypeCLI.swift):--import-stackimport-projectplus its sub-options--loose-media-manifest,--loose-media-source-root,--loose-media-replacement-root,--loose-media-names,--loose-media-aliases-json,--stack-library-json,--used-stack-aliases,--no-replace-existing-project-output. Project import still runs viaStackImportPackageProjectImporter(used byHypeDebugServerandHypeCore/MystStackImportAcceptanceTests).--validate-package. SQLite package validation still runs viaHypeSQLiteStackStore.validate(packageURL:)(used byTargetRuntimePackageBuilderand persistence tests).--parse-onlyflag (unused).runImportStackImportProject,validatePackageFile, JSON/CSV decoders,PackageValidationReport,ProjectImportOutput) and the mutual-exclusion validators invalidate().Simplified
ScriptSemanticValidator(Sources/HypeCLI/HypeCLI.swift):statementsIssuesAcrossCardContexts,localHandlerCallCardContexts,validationCardContexts).go-statement card-context propagation throughstatementIssues/statementsIssues.legacyCardIdresolution,currentStackLibraryEntry,resolveLocalLegacyCardId,staticNavigationTarget.functionHandlerInMessagePath,messagePathScripts).pass-through hook exceptions; hooks are now checked uniformly viaallowedHooks(for:).expressionIssues/statementIssuesno longer threadmessageNamesoreffectiveCardId; bare-handler-call findings reintroduced as a directmessageNamescheck.staticLiteralString→staticString, addedstaticObjectReferenceNameandstaticSoundNamehelpers, andstackLibraryHasCardReference→stackLibraryContainsCard."id"fromknownBuiltInFunctionsand trimmedstackHooksto the dispatched set.Tests (
Tests/HypeCLITests/HypeCLITests.swift): removed the suites covering the retired options; kept the 34 remaining CLI integration tests (arithmetic, chunks, import-summary/output-package/corpus, validate-scripts semantics, benchmark columns, inference smoke).Testing & Verification
swift test --filter HypeCLITests→ 34/34 passed in a clean worktree rebased onorigin/main.HypeCLItarget:swift build --target HypeCLI→ clean.--import-stackimport-project,--validate-package,--loose-media-*,--parse-only) outside the deleted code. The underlyingStackImportPackageProjectImporterandHypeSQLiteStackStore.validate(packageURL:)APIs remain in HypeCore and are still exercised byHypeDebugServer,TargetRuntimePackageBuilder, and HypeCore tests.Screenshots / GIFs
N/A — no UI change.
Checklist
architecture.mdanddecisions.md.README.md/architecture.md; the underlying APIs remain)..hypestack documents.--validate-scriptsto capture the new baseline.Diff scope: 2 files, +153 / −1313. Build: ✓. Tests: 34/34 ✓.