Skip to content

ADFA-4128 (5/11): quickbuild:core — change detection & classification - #1717

Open
fryanpan wants to merge 2 commits into
feature/ADFA-4128-qb-04-runtimefrom
feature/ADFA-4128-qb-05-core-detection
Open

ADFA-4128 (5/11): quickbuild:core — change detection & classification#1717
fryanpan wants to merge 2 commits into
feature/ADFA-4128-qb-04-runtimefrom
feature/ADFA-4128-qb-05-core-detection

Conversation

@fryanpan

@fryanpan fryanpan commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Part 5/11 of the stacked split of #1669 (requested by Akash). Base: feature/ADFA-4128-qb-04-runtime. Stack overview + review mechanics: PR 1 (#1713). Terms are defined in quickbuild/README.md (lands in PR 1).

This is the first of several PRs for the Quick Build core that runs inside of Code on the Go.

Lets Quick Build notice every change a developer makes, however it arrives, so nothing ever builds stale.

flowchart LR
    save(["file write: editor save,<br/>git pull, Termux script"]) --> w
    subgraph s5["<b>This PR: core slice 1 — change detection</b>"]
        w["AndroidProjectWatcher (data)<br/>FileObserver + mtime poll<br/><i>AndroidProjectWatcher.kt</i>"] --> rec["WatcherBatchReconciler +<br/>trailing-debounce coalescing<br/>(domain/watch)<br/><i>WatcherBatchReconciler.kt</i>"]
        rec --> cls["ChangeClassifier (domain/classify)<br/>annotation-aware;<br/>assetsLiveReloadable gate<br/><i>ChangeClassifier.kt</i>"]
        ann["SourceAnnotationScanner<br/>(domain/annotations)<br/><i>SourceAnnotationScanner.kt</i>"] --- cls
    end
    cls -- "BuildRoute" --> orch["orchestration slice (PR 8)<br/>runs the route"]
    classDef thisPrBox fill:#dbeafe,stroke:#93c5fd,color:#1e3a5f
    classDef inPr fill:#ffffff,stroke:#64748b,color:#000
    class s5 thisPrBox
    class w,rec,cls,ann inPr
Loading

What to review

  • ChangeClassifier.kt — picks the cheapest still-correct route. The routing contract; line-by-line.
  • AndroidProjectWatcher.kt, WatcherBatchReconciler.kt — watch rules, phantom-deletion guard, save-burst coalescing.
  • SourceAnnotationScanner.kt — why an annotation edit is not just a code edit.
  • Each package carries a README stating its contract — read those first.
  • John's detection findings (C6, C7, C8, C20, C21) folded in as fixes.

How this PR Was Tested

  • 17 test files, plus the RoomAppFixture and OfflineGuard network check.
  • [verified 2026-08-21] At this cut: :quickbuild:core:test — only this slice's files exist yet, so the module suite is exactly the slice suite: 17 test files (16 suites; RoomAppFixture is a fixture), 221 tests per variant across all 6 variants, 0 failures, 0 errors. Coverage 97.4% line / 94.9% branch.
  • End-to-end evidence: PR 11.

Coverage (JaCoCo at the stack tip, single run):

Package Line Branch Note
…quickbuild.data 85.0% 60.0% WatchService overflow paths need a real watcher
…quickbuild.domain 100.0% 100.0%
…quickbuild.domain.annotations 99.3% 97.3%
…quickbuild.domain.classify 99.2% 97.8%
…quickbuild.domain.watch 100.0% 94.3%
NON-UI TOTAL 97.4% 94.9% 734 lines, 506 branches

14 source files in the diff, all 14 measured.

Slice 1 of 4 — next: deploy and reload (PR 6).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W

@fryanpan
fryanpan force-pushed the feature/ADFA-4128-qb-05-core-detection branch from 1e2eafe to bdfdc6c Compare August 22, 2026 06:41
fryanpan and others added 2 commits August 21, 2026 23:56
…alesce a save burst, classify the cheapest correct route

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W
…ndness (Blocker) + MOVED_TO watch

Blocker (SourceAnnotationScanner TYPE_DECLARATION): the declared-name regex captured "class" for
Kotlin `enum class`, and had no branch for `typealias` or top-level `const val`, so edits to such
anchor files classified as reload-safe and shipped stale generated code. Fixed the alternation
(`enum\s+class` first) and added `typealias` + `const\s+val` branches; added the conservative
backstop in AnnotationImpactAnalyzer (a declaration change in a file declaring no recognized name
escalates while a processor is active). Covered by AnnotationImpactAnalyzerTest: "adding an entry
to an enum class an entity stores escalates", "retargeting a typealias an entity column uses
escalates", "bumping a top-level const the database version reads escalates", and "a declaration
change in a file declaring no recognized name escalates".

Important (AndroidProjectWatcher): directory MOVED_TO never triggered watch registration, leaving
a renamed/moved-in package inotify-blind for the session. The recursion gate now fires on
CREATE or MOVED_TO; files inside the moved tree are supplied by the poll sweep. FileObserver glue
is JVM-inert in this module (isReturnDefaultValues), so the gate carries a precise comment rather
than a faked test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W
@fryanpan
fryanpan force-pushed the feature/ADFA-4128-qb-05-core-detection branch from bdfdc6c to cd01ada Compare August 22, 2026 07:05
@fryanpan
fryanpan marked this pull request as ready for review August 23, 2026 02:31

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant