Move all exported types to interfaces.go for consistent organisation.
Rename interface.go → interfaces.go.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move handler functions from mode.go to actions.go:
- OnMissingKey, SetActionHandler, dispatchMissingKey
mode.go now contains only Mode type and constants.
interface.go keeps all types/interfaces.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate all compose-related tests into a single file for better
organisation. The grammar composition tests that verify intent templates
now live alongside the Subject tests.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The "intents" concept is gone - this is now just test data for
verifying the grammar composition functions produce correct strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add compose_intents_test.go with comprehensive tests that verify
the grammar engine can compose the same strings as intent templates
- Add irregular verbs: overwrite, reset, reboot
- Fix PastTense for words ending in -eed (proceed, succeed, exceed)
that were incorrectly treated as already being past tense
- Tests verify ActionResult, ActionFailed, Progress work for all
43 core intent verbs
- Demonstrates that semantic intents can be replaced by grammar
composition functions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
These are now redundant with the i18n.* namespace magic:
- P("fetch") → T("i18n.progress.fetch")
- PS("build", "x") → T("i18n.progress.build", "x")
- L("status") → T("i18n.label.status")
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move MissingKeyHandler, MissingKey, MissingKeyAction, and PluralRule
function types to interface.go for better discoverability.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move isVerbFormObject, isNounFormObject, hasPluralCategories,
isPluralObject to dedicated file.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move Service struct, methods, constructors, and singleton management
to dedicated file for better code organization.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add TimeAgo(t time.Time) for relative time strings
- Add FormatAgo(count, unit) for "N units ago" composition
- Add i18n.ago namespace pattern: T("i18n.ago", 5, "minute")
- Uses existing time.ago.{unit} keys with CLDR pluralization
- Remove local formatTimeAgo from cmd/php in favor of i18n.TimeAgo
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests for core.label, core.progress, core.count, core.done, core.fail
patterns. Also tests Raw() bypasses core.* magic.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
T() now auto-composes grammar patterns for core.* keys:
- core.label.{word} → "Status:"
- core.progress.{verb} → "Building..."
- core.count.{noun}, n → "5 files"
- core.done.{verb}, subj → "File deleted"
- core.fail.{verb}, subj → "Failed to delete file"
_() and Raw() do direct key lookup without magic.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extend grammar system to support base words and punctuation rules:
- gram.word.* for base word translations
- gram.punct.label for language-specific label suffix (FR: " :")
- gram.punct.progress for progress suffix
Label() and Progress() are now language-aware:
- L("status") → EN: "Status:" / FR: "Statut :"
- P("build") → EN: "Building..." / FR: "Construction..."
This enables ~80% reduction in locale file size by composing
phrases at runtime instead of storing every variant.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename MissingKeyAction to MissingKey and add OnMissingKey() handler.
Keeps focus on missing keys only for QA - no unnecessary trace overhead.
- MissingKey: dispatched when T()/C() can't find a key in ModeCollect
- OnMissingKey(): register handler for missing key events
- SetActionHandler(): deprecated, use OnMissingKey()
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move debug mode code to dedicated file for better code comprehension.
Go's package-level file globbing allows splitting functionality
across files while maintaining a single cohesive package.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move grammar data (verbs, nouns, articles) from "common" to "gram"
namespace - a tribute to Gram (grandmother) and short for grammar.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds cmd/i18n-validate that scans Go source files for i18n key usage
and validates them against locale JSON files and registered intents.
Features:
- Scans T(), C(), I(), and qualified i18n.* calls
- Expands ./... pattern to find all Go packages
- Validates message keys against locale JSON files
- Validates intent keys against registered core.* intents
- Reports missing keys with file:line locations
- Skips constant references (type-safe usage)
Usage:
go run ./cmd/i18n-validate ./...
task i18n:validate
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add SetDebug()/Debug() methods for showing key prefixes in output
- Debug mode shows: "[cli.success] Success" instead of "Success"
- Add NewSubject() as alias for S() for readability
- Both T() and C() respect debug mode
Debug mode is useful for:
- Identifying which translation keys are used where
- Verifying correct key usage during development
- QA testing of translation coverage
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rewrite i18n package to handle nested JSON natively
- Remove go-i18n dependency in favour of simple custom implementation
- Flatten nested keys to dot notation internally (cli.confirm.yes)
- Support pluralisation with one/other keys
- Template interpolation with {{.Var}} syntax
- Update tests for new API and nested structure
Nested JSON is the standard format for translation tools,
making it easier to manage with external translation services.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add i18n service wrapping pkg/i18n for translations via cli.T()
- Add log service with levels (quiet/error/warn/info/debug)
- Wire cli.Init() in cmd.Execute() with explicit service names
- Fix main.go to print errors to stderr and exit with code 1
- Update runtime.go to accept additional services via Options
Services use WithName() to avoid name collision since both are
defined in pkg/cli (WithService would auto-name both "cli").
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- cli.Success(), cli.Error(), etc. now print directly
- String-returning versions renamed to cli.FmtSuccess(), etc.
- Removes App() from common usage path
- Usage: cli.Success("done") instead of fmt.Println(cli.Success("done"))
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Moves shared utilities (styles, utils) from cmd/shared to pkg/cli.
Adds CLI runtime with global singleton pattern:
- cli.Init() initialises the runtime
- cli.App() returns the global instance
- OutputService for styled terminal printing
- SignalService for graceful shutdown handling
All cmd/ packages now import pkg/cli instead of cmd/shared.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the Core IPC design with four dispatch patterns:
- ACTION: fire-and-forget broadcast (existing)
- QUERY: first responder returns data
- QUERYALL: all responders return data
- PERFORM: first responder executes task
Updates git and agentic services to use Query/Task patterns.
Adds dev service for workflow orchestration.
Refactors dev work command to use worker bundles.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents the four dispatch patterns (ACTION, QUERY, QUERYALL, PERFORM),
worker bundle architecture, and permissions-through-presence model.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Aligns package name with directory structure (pkg/framework/core).
Fixes doc comment in e.go and adds core binary to gitignore.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add pkg/framework/framework.go for cleaner imports
- Add pkg/git/service.go with Core service wrapper
- Add pkg/agentic/service.go with AI/Claude service wrapper
- Services use IPC pattern with ACTION() dispatch
Usage:
import "github.com/host-uk/core/pkg/framework"
app, _ := framework.New(
framework.WithService(git.NewService(git.ServiceOptions{})),
framework.WithServiceLock(),
)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add pkg/framework/core with GUI-agnostic DI/service framework
(extracted from core-gui, Wails dependencies removed)
- Add pkg/agentic/prompts with embedded commit instructions
- Improve dev push: detect uncommitted changes, offer Claude commit
- Add claudeEditCommit for cases needing Write/Edit permissions
- Add i18n keys for diverged branches and uncommitted changes
- Fix infinite loop when only untracked files remain after commit
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>