feat(debt): adopt // sin-debt: <ceiling>, upgrade: <trigger> marker convention#207
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
11 tasks
Delqhi
pushed a commit
that referenced
this pull request
Jun 16, 2026
…onvention (issue #177) Closes #177 Adds a first-class, byte-stable scanner and CLI for the sin-debt marker convention adopted from ponytail v4.7.0. Every intentional shortcut can now carry a marker naming its ceiling and the trigger to revisit. Components: - cmd/sin-code/internal/sindept/{parser,stats,report,policy}.go - regex over 5 comment families (//, #, --, /* */, <!-- -->) - byte-deterministic aggregation; render has FormatVersion v1 - configurable policy (default reasons + upgrade triggers + threshold) - cmd/sin-code/debt_cmd.go: list | stats | check | policy | fix | export - cmd/sin-code/internal/sindept/sindept_test.go: 23 race-clean tests - cmd/sin-code/internal/sindept/testdata/: 10 golden markers (5 langs) - docs/sin-debt-convention.md: author-facing reference - 4 real // sin-debt: markers placed in production code - permission_defaults.go: sindept__* rules (read-only allow, gates ask) - AGENTS.md / CHANGELOG.md: §6, §10 sin-debt section + Unreleased entry Verified: gofmt clean, go vet clean, go build ./... clean, race-clean, golangci-lint 0 issues, govulncheck 0 vulns, gosec 0 findings on new files.
Contributor
|
Deployment failed with the following error: Learn More: https://vercel.com/manheiler-8784s-projects?upgradeToPro=build-rate-limit |
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown)
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown) Run ID:
|
| } | ||
| stats := sindept.AggregateStats(mk) | ||
| content := sindept.RenderListString(mk) + "\n" + sindept.RenderStatsString(stats) | ||
| if err := os.WriteFile(dest, []byte(content), 0o644); err != nil { |
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.
Summary
Adopts ponytail v4.7.0's
ponytail:marker convention as a first-class,parseable
// sin-debt: <ceiling>, upgrade: <trigger>convention forSIN-Code (issue #177). Every intentional shortcut in source code now
carries a marker naming its ceiling and the trigger to revisit.
Components
internal/sindept/package (cmd/sin-code/internal/sindept/)parser.go—Marker{File,Line,Column,Reason,Upgrade,HasUpg,Raw,Language,Symbol},precompiled regex over five comment families (
//,#,--,/* */,<!-- -->),ParseFile+ParseDir. Trims trailing block-comment closers (*/,-->)from captured clauses for byte-deterministic output. Best-effort
Symbolresolver walks up to 40 lines for
func name(...)/def name(...).stats.go—Stats{Total, WithUpgrade, WithoutUpgrade, ByFile, ByReason, ByLanguage, BySymbol, RotRisk, Oldest, MarkersPerFile}. Every map ismaterialized as a lex-sorted
[]KVso reports are stable.report.go—RenderStats/RenderStatsString/RenderListStringwith
FormatVersion = "sin-debt/v1". Two scans of the same tree emitthe same bytes — the precondition for the four-arm comparator
golden snapshot (issue feat(eval): three-arm eval harness (baseline/terse/<skill>) with --compare and snapshot round-trip #171).
policy.go—Policy{DefaultReasons, UpgradeTriggers, MaxNoUpgrade, RequireUpgrade, Source}. TOML overlay via.sin-code/debt-policy.toml.LoadPolicyForRootwalks upward to the closest file. Default policyships 21 reason phrases + 8 upgrade triggers.
debt_cmd.go— 41st subcommandsin-code debt list | stats | check | policy | fix | exportwith sharedflags (
--path,--format table|json,--no-trigger).statstakes--by file|reason|language|symbol|age|summary.checkexits non-zerowhen
Missing > MaxNoUpgradeorRequireUpgrade=true && Missing > 0.Documentation
docs/sin-debt-convention.md— author-facing referencecmd/sin-code/debt_cmd.doc.md— CLI referencecmd/sin-code/internal/sindept/sindept.doc.md— package internalsPermission defaults (
internal/permission_defaults.go)sindept__list,sindept__stats,sindept__policysindept__check,sindept__fix,sindept__exportReal markers placed in production code
cmd/sin-code/internal/orchestrator/dispatcher.go—global mutex(plan-level state)cmd/sin-code/internal/lessons/store.go:173— 16-hex fingerprint collisioncmd/sin-code/internal/lessons/store.go:181— linear Briefing scancmd/sin-code/internal/ledger/store.go:173— Sessions DISTINCT scanTest fixtures
10 golden markers across 5 languages:
cmd/sin-code/internal/sindept/testdata/markers.{go,py,ts,sh,md}23 tests cover family coverage, trailing-closer stripping, byte-stability,
vendor / hidden-dir walk, age/rot grouping, policy gates above/below threshold
plus the
require_upgrade=truestrict mode.Verification
Acceptance criteria
cmd/sin-code/internal/sindept/package — Scanner, Aggregator, Reporter, Policycmd/sin-code/debt_cmd.go— 6 subcommands (list, stats, check, policy, fix, export)// sin-debt: <ceiling>, upgrade: <trigger>parses in 100% of cases (5/5 languages)no-trigger(rot-risk) detection — verified byTestPolicyCheckFailsOverThresholddocs/sin-debt-convention.mdexists with format spec + 5 real examples-racegolangci-lint,govulncheck,gosecclean on new filesCloses #177