* feat(qa): add qa watch command for CI monitoring (#47)
Implements `core qa watch` to monitor GitHub Actions after a push:
- Polls workflow runs for a commit until completion
- Shows live progress with pass/fail counts
- On failure, shows job name, failed step, and link to logs
- Exits with appropriate code (0 = passed, 1 = failed)
Usage:
core qa watch # Watch current repo's HEAD
core qa watch --repo X # Watch specific repo
core qa watch --timeout 5m # Custom timeout
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(qa): address CodeRabbit feedback on watch command
- Add length check before slicing commitSha to prevent panic on short SHAs
- Count all non-success conclusions as failures (cancelled, timed_out, etc.)
- Use errors.E/Wrap pattern for consistent error handling with operation context
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add context-aware commands and log parsing
- Use exec.CommandContext with timeout context for all gh invocations
so commands are cancelled when deadline expires
- Implement fetchErrorFromLogs using 'gh run view --log-failed'
to extract first meaningful error line from failed workflows
- Pass context through call chain for proper timeout propagation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add review command for PR status (#62)
Add `core qa review` command to show PR review status with actionable
next steps. Answers: "What do I need to do to get my PRs merged?"
and "What reviews am I blocking?"
Features:
- Shows your open PRs with merge status (CI, reviews, conflicts)
- Shows PRs where your review is requested
- Provides actionable suggestions (rebase, address feedback, etc.)
- Flags: --mine, --requested, --repo
Closes#62
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add review command for PR status (#62)
Add `core qa review` command to show PR review status with actionable
next steps. Answers: "What do I need to do to get my PRs merged?"
and "What reviews am I blocking?"
Features:
- Shows your open PRs with merge status (CI, reviews, conflicts)
- Shows PRs where your review is requested
- Provides actionable suggestions (rebase, address feedback, etc.)
- Flags: --mine, --requested, --repo
Closes#62
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(qa): address CodeRabbit feedback on review command
- Fix truncate to use runes for UTF-8 safe string slicing
- Remove unused user parameter from showMyPRs and showRequestedReviews
- Remove unused getCurrentUser function
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(qa): remove duplicate i18n block and improve error handling
- Remove duplicate cmd.qa block in en_GB.json
- Use errors.E consistently for error wrapping
- Require --repo flag when not in a git repository
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix(i18n): restore missing translation keys for health command
The locale consolidation in 39de3c2 removed keys still used by
cmd_health.go. Added back:
- cmd.dev.health.* keys (long, repos, to_push, to_pull, etc.)
- common.status.* keys (dirty, clean, synced, up_to_date)
- common.flag.registry
Also fixed workspace.LoadConfig() returning default PackagesDir
when no .core/workspace.yaml exists, which was overriding repo
paths from repos.yaml.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add nil checks for workspace.LoadConfig callers
LoadConfig now returns nil when no .core/workspace.yaml exists.
Added defensive nil checks to all callers to prevent panics.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: align workspace.LoadConfig error handling
Both call sites now gracefully ignore errors and fall back to defaults,
since workspace config is optional for setup commands.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add qa watch command for CI monitoring (#47)
Implements `core qa watch` to monitor GitHub Actions after a push:
- Polls workflow runs for a commit until completion
- Shows live progress with pass/fail counts
- On failure, shows job name, failed step, and link to logs
- Exits with appropriate code (0 = passed, 1 = failed)
Usage:
core qa watch # Watch current repo's HEAD
core qa watch --repo X # Watch specific repo
core qa watch --timeout 5m # Custom timeout
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(qa): address CodeRabbit feedback on watch command
- Add length check before slicing commitSha to prevent panic on short SHAs
- Count all non-success conclusions as failures (cancelled, timed_out, etc.)
- Use errors.E/Wrap pattern for consistent error handling with operation context
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add context-aware commands and log parsing
- Use exec.CommandContext with timeout context for all gh invocations
so commands are cancelled when deadline expires
- Implement fetchErrorFromLogs using 'gh run view --log-failed'
to extract first meaningful error line from failed workflows
- Pass context through call chain for proper timeout propagation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat(setup): add github command for repo configuration (#45)
Implements `core setup github` to configure GitHub repos with org
standards including labels, webhooks, branch protection, and security
settings. Supports dry-run mode, per-repo or all-repos operation, and
selective sync of specific settings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(setup): address CodeRabbit feedback on github command
- Sort map keys for deterministic diff output in github_diff.go
- Preserve partial results by adding changes before continue on errors
- Reject conflicting --repo and --all flags with clear error message
- Allow empty webhook URLs (skip instead of error) for optional env vars
- Add content_type comparison in webhook sync
- Add required_status_checks comparison in branch protection sync
- Add DisableDependabotSecurityUpdates for bidirectional security control
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(setup): address additional CodeRabbit feedback
- Use filepath.Join for OS-portable path construction in github_config.go
- Fix stringSliceEqual to use frequency counting for proper duplicate handling
- Simplify change accumulation with variadic append
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Add i18n.RegisterLocales(fsys, dir) for packages to register translations
- Locales are automatically loaded when i18n.Init() is called
- Fix gram.word.* loading bug (strings were in wrong switch case)
- Fix loadJSON to merge messages instead of replacing
- Add common.* keys to base locale (labels, flags, progress, etc.)
- Add pkg/php/locales with PHP-specific translations
- pkg/php/i18n.go registers locales via init()
This enables the idiomatic pattern where packages register their
locale files and they're automatically loaded by the i18n system.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- LoadFS: Use path.Join instead of filepath.Join for fs.FS compatibility
- AddHandler: Document handler chain lock behavior
- getEffectiveFormality: Support string values ("formal", "informal")
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- service.go: Simplify Default() to just call Init() (sync.Once handles idempotency)
- service.go: Add nil check to SetDefault() with panic
- service.go: Add documentation for ModeStrict panic behavior
- loader.go: Add LanguagesErr() to expose directory scan errors
- loader.go: Use path.Join instead of filepath.Join for fs.FS compatibility
- transform.go: Add uint, uint8-64, int8, int16 support to type converters
- grammar.go: Replace deprecated strings.Title with unicode-aware implementation
- i18n_test.go: Add comprehensive concurrency tests with race detector
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- hooks.go: Use atomic.Value for missingKeyHandler global
- loader.go: Use sync.Once for FSLoader.Languages() caching
- service.go: Use atomic.Pointer[Service] for defaultService
All globals that could race between goroutines now use proper
synchronization primitives.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add NewWithLoader(loader, opts...) for custom storage backends
- Add Option type with WithFallback, WithFormality, WithHandlers,
WithDefaultHandlers, WithMode, WithDebug options
- Update New() and NewWithFS() to accept options
- Add loader field to Service struct
- Remove NewSubject() alias (use S() instead)
- Add tests for new options and NewWithLoader
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Article("") now returns "" for consistency with other grammar
functions (PastTense, Gerund, PluralForm, Label all return "")
- Add doc comment to getMessage() for consistency with other
internal helpers
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- CurrentLanguage() now returns "en-GB" (fallback) instead of "" when
service is nil, consistent with other getters returning defaults
- Document why SetLanguage returns error (validates language tag) while
SetMode, SetFormality, SetDebug do not (just set values)
- Add "Does nothing if service not initialized" to Set* doc comments
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add explicit nil checks to toInt, toInt64, toFloat64 for consistency
- Standardize error messages to use %q for user-provided strings
- Export GetGrammarData for symmetry with SetGrammarData
- Standardize String() doc comments to "the TypeName" pattern
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add int32 and float32 handling to toInt() for consistency with
toInt64() and toFloat64()
- Remove unusable _() function (can't be called as i18n._())
- SetLanguage() now returns ErrServiceNotInitialized when service
is nil instead of silently succeeding
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove incorrect "Panics if called on nil receiver" from chainable
Subject methods (they actually return nil safely)
- Add Raw() as named alias for _() matching Service.Raw()
- Add package-level wrappers: SetLanguage(), CurrentLanguage(),
SetMode(), CurrentMode()
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add CountString() to return count as string
- Fix FormalityString() to return string instead of Formality type
- Both Int and String getters now available for count field
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename Subject getters from GetX() to idiomatic Go naming:
- GetCount → CountValue
- GetGender → GenderValue
- GetLocation → Location
- GetNoun → NounValue
- GetFormality → FormalityValue
Add comprehensive tests for checks.go and mutate.go functions
that will be useful for future CLDR plural category support.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove since this is a new package with no external users:
- SetActionHandler() - use OnMissingKey() instead
- MissingKeyAction type alias - use MissingKey instead
Update tests to use current API.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>