Skip to content

refactor(engine): merge detect + platform into one deep Environment module (deepening #5)#253

Merged
ycpss91255 merged 1 commit into
mainfrom
feat/env-deepening
Jun 21, 2026
Merged

refactor(engine): merge detect + platform into one deep Environment module (deepening #5)#253
ycpss91255 merged 1 commit into
mainfrom
feat/env-deepening

Conversation

@ycpss91255

Copy link
Copy Markdown
Owner

Summary

Architecture deepening #5 (grilling-locked): merge lib/detect.sh +
lib/platform.sh into one deep lib/environment.sh (438 lines, under the 800
rule). Internally layered: private _environment_probe_* (I/O) ->
_environment_classify (form_factor logic) behind a small interface ->
environment_snapshot() (full {os,arch,cpu,gpu,...,form_factor} in one call)

  • environment_field(). Backward-compat aliases kept (detect_environment,
    detect_get_field, platform_classify, platform_export_env); the dispatcher
    fetches the snapshot once; the runner reads gpu via environment_field.
    detect --json output is byte-identical (golden test) so the ADR-0019-adjacent
    TUI/agent contract holds. Adds Environment to CONTEXT.md.

Test plan

  • test-unit: 3983 pass, 0 fail (worktree)
  • test-integration: pass
  • coverage AC-17: 80.81% (sharded merge); env 85.3% / dispatcher 82.8% /
    runner 93.9%
  • lint clean (no new shellcheck disables; platform_export_env takes a
    required arg to satisfy SC2119/2120 without a disable)
  • detect --json golden output unchanged
  • rebased onto current main; no conflicts
  • CI re-runs the full gate

Deepening candidate #5. .agents/memory untouched.

Generated with Claude Code.

…odule (deepening #5)

lib/detect.sh + lib/platform.sh collapse into lib/environment.sh (438 lines,
under the 800 rule), internally layered private _environment_probe_* (I/O) ->
_environment_classify (form_factor logic) behind a small interface:
environment_snapshot() (full {os,arch,cpu,gpu,...,form_factor} in one call) +
environment_field(). Backward-compat aliases retained (detect_environment,
detect_get_field, platform_classify, platform_export_env) so callers and the
`detect` subcommand are unchanged. Dispatcher fetches the snapshot once; runner
reads gpu via environment_field. `setup_ubuntu detect --json` output is
byte-identical (golden test) so the ADR-0019-adjacent TUI/agent contract holds.
Adds Environment to CONTEXT.md.

Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@ycpss91255 ycpss91255 enabled auto-merge (squash) June 21, 2026 16:12
@ycpss91255 ycpss91255 merged commit f905e98 into main Jun 21, 2026
53 checks passed
@ycpss91255 ycpss91255 mentioned this pull request Jun 23, 2026
3 tasks
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