Merged
Conversation
Add docs/reference/audit-conventions.md — contributor-facing guide
covering all 34 internal/audit/ tests with before/after examples
and fix patterns.
Remove 4 overly broad exemptions from TestNoMagicStrings: format
verbs ("%d", "%x"), URL scheme prefixes ("https://"), HTML entities
("<"), and internal/err/ package exemption. Fix all 17 surfaced
violations by replacing fmt.Sprintf with strconv/hex stdlib calls
and extracting magic strings to config constants (cfgHTTP.Prefix*,
cfgGit.FlagLastN, cfgWarn.CopilotClose, cfgWarn.JSONEncode).
Spec: specs/ast-audit-contributor-guide.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
All user-facing format strings in write/steering, write/skill, write/trigger, write/setup, mcp/handler, trigger/, and drift/ now go through desc.Text() with YAML-backed DescKeys. Added 42 YAML entries in ui.yaml and 30 DescKey constants across 6 config/embed/text files (steering.go, trigger.go new; skill.go, setup.go, mcp_tool.go, drift.go updated). Also adds predicate naming convention section to audit-conventions.md. Spec: specs/ast-audit-contributor-guide.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Config const blocks with group docs are exempted from per-constant doc checks. This lets ~1300 DescKey constants through without individual docs. Added comment documenting the gap; tracked as task for future tightening. Spec: specs/ast-audit-contributor-guide.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
… exemptions
Tighten TestDocComments so config/embed/ packages no longer get a
blanket exemption for const blocks — DescKey names like
DescKeyWriteSetupDeployMCP are not self-documenting. Added
per-constant doc comments to all ~1716 exported constants across
172 files in config/embed/{text,cmd,flag}.
Add "DO NOT widen" guard comments to all 10 exemption/allowlist
data structures across 7 audit test files. These prevent agents
from adding drive-by entries to make tests pass instead of fixing
the code.
Spec: specs/ast-audit-contributor-guide.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Remove blanket isConstDef exemption from TestNoMagicStrings — const
definitions outside config/ are now caught as magic strings. All 156
violations resolved:
- Typed string enums (IssueType, TriggerType, InclusionMode,
ResourceStatus, ResourceKind, CheckName, StatusType) moved to
config/{drift,trigger,steering,sysinfo}/ with types.go convention.
- Path/label constants moved to config/{io,setup,skill,steering,
trigger,hook,rc,bootstrap,dep}/.
- Templates (bash script scaffold, steering foundation files) moved
to assets/tpl/{tpl_trigger,tpl_steering}.go.
- User-facing messages moved to YAML + desc.Text().
- Duplicate paramSummary replaced with field.Summary.
- Dead LabelAllTools in config/trigger deleted.
- Mixed visibility fix: hooks() moved to separate file.
- config/README.md updated with config/ vs entity/ type guidance.
Spec: specs/ast-audit-contributor-guide.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
…bility Unexport 5 test-only symbols (RegistryError, CreateVSCodeArtifacts, LockedFrontmatterLine, RegisteredTools, MatchFull) and delete 1 (ErrCodeInvalidReq). Remove 6 entries from testOnlyExports (11 remain, all cross-package — tracked for future sessions). Extract shared MCP deploy helper (cli/setup/core/mcp/) eliminating 3-way duplication across cursor/cline/kiro deploy.go files. Both ensureMCPConfig and syncSteering now delegate to the shared package. Fix mixed visibility: move registryError() and registeredTools() to separate files (hooks.go, tools.go). Replace LockedFrontmatterLine test usage with source constant session.FrontmatterLockedLine. Spec: specs/ast-audit-contributor-guide.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Replace 2 unhandled fmt.Fprintf calls with ctxIo.SafeFprintf which logs write errors via warn.Warn per project convention. Spec: specs/ast-audit-contributor-guide.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Remove blanket isConstDef/isVarDef exemption from TestNoMagicValues — numeric const definitions outside config/ are now caught. All 7 violations resolved: - JSON-RPC error codes (ErrCodeParse, ErrCodeNotFound, ErrCodeInvalidArg, ErrCodeInternal) moved from mcp/proto/schema.go to config/mcp/schema/. Updated 14 consumer sites + 1 test file. - DefaultPriority (50) moved to config/steering/. Updated steering/frontmatter.go and cli/steering/cmd/add/cmd.go. - PollIntervalSec (5) moved to config/mcp/server/. - Removed dead isVarDef helper from magic_values_test.go. Spec: specs/ast-audit-contributor-guide.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
…rors Extract duplicated frontmatter splitting logic from steering/ and skill/ into parse.SplitFrontmatter. Both callers now delegate to the shared function and wrap errors with domain-specific context. Delete 4 dead error constructors (MissingOpeningDelimiter, MissingClosingDelimiter in err/steering and err/skill) and their DescKey constants + YAML entries. Add new err/parser delimiter constructors used by the shared function. Spec: specs/ast-audit-contributor-guide.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Replace 3 structurally identical memory/swap/disk check blocks with a data-driven loop over a byteCheck slice. Same behavior, less repetition. Spec: specs/ast-audit-contributor-guide.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Rename isConsumerLayer → consumerLayer in cross_package_types_test.go
and isSyncableTool → syncableTool in steering/{format,sync}.go.
isNumeric was already removed during earlier migrations.
Persist session decisions and learnings.
Spec: specs/ast-audit-contributor-guide.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
…ge test usage Remove the testOnlyExports allowlist entirely. Instead, add Phase 2.5 to TestNoDeadExports that loads packages with Tests: true and removes symbols used cross-package in test files. A symbol imported by a test in a different package is test infrastructure, not dead. Also fix parser.findParser → parser.find (stuttery name) and move to tools.go (mixed visibility). Spec: specs/ast-audit-contributor-guide.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
Deploying ctx with
|
| Latest commit: |
d35e98b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c3b407ff.ctx-bhl.pages.dev |
| Branch Preview URL: | https://feature-lint.ctx-bhl.pages.dev |
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.
No description provided.