Skip to content

feat: tarsier check policy (TAR-47) + otel/semconv-drift (TAR-63) - #6

Merged
Pieczasz merged 10 commits into
mainfrom
cursor/tar-47-63-policy-semconv-8703
Sep 19, 2026
Merged

Pieczasz merged 10 commits into
mainfrom
cursor/tar-47-63-policy-semconv-8703

Conversation

@Pieczasz

@Pieczasz Pieczasz commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Implements two Linear targets:

TAR-47 — tarsier check + policy file

  • New tarsier check --policy observability-policy.yaml [path]
  • Opt-in blocking classes only: unbounded-metric-labels, secrets-in-logs, missing-propagation, removed-required-events
  • Parse-time reject for unknown entries and layer-4 logs/unstructured-logging
  • Shares scan engines + lifecycle (--baseline / --baseline-write)
  • Exit 1 only when opted-in blocking findings match; documented in --help and README

TAR-63 — otel/semconv-drift

  • Go + TS rules for deprecated HTTP attribute names (http.method, http.target, …)
  • Precision gate: only when attribute/semconv (Go) or @opentelemetry/api|semantic-conventions (TS) is imported
  • Advisory info severity; migration guide in note
  • Ruletests + badshop fixtures

Make / toolchain

  • make dead/modern/vuln: pin GOTOOLCHAIN=$(go env GOVERSION) so go run tool@version does not downgrade to the tool module’s older go line (x/tools v0.50 → 1.26 vs module go 1.27.1)
  • make dead also fails on deadcode non-zero exit (package load errors), not only non-empty stdout
  • Synced otel-semconv-drift-go ast-grep snapshot to blank-import fixture

Verification

  • make dead / make modern / make vuln
  • make lint
  • make test
  • make rules (ast-grep test)
  • make tidy

Pieczasz and others added 10 commits September 19, 2026 09:27
Add `tarsier check --policy` with opt-in blocking classes only;
reject layer-3/4 and unknown block entries at parse time. Honour
baseline. Document exit codes.

Add Go/TS otel/semconv-drift rules for deprecated HTTP attribute
names (advisory), with ruletests and badshop fixtures.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
Bugbot/security: validate trimmed block entries but blockedRules used
raw strings, so padded class names silently disabled the gate.

Ponytail: hoist normalizeEngine/ensurePatternRules/runEngines for scan
and check; drop unused gocyclo nolint.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
Lock the property behind the whitespace bypass: after validate succeeds,
Block is trimmed and blockedRules expands every mapped rule. Prefer
stdlib fuzz over a property-testing dependency.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
Property tests for fingerprint/suppressions/partition, version+JSON
decode, multi-lang Analyze, and CI gate counters. Prefer testing.F
over rapid (no new dep). Corpus keeps the blockingCount threshold=0 edge.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
go run tool@version was switching to the tool module's older go line
(x/tools v0.50 → 1.26) while this module requires go 1.27.1, so deadcode
failed with "package requires newer Go version". Pin each go-run tool to
$(go env GOVERSION) so analysis uses the same toolchain as the module.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
Propagate deadcode non-zero exit (package load failures) instead of only
checking stdout. Update otel-semconv-drift-go snapshot to match the blank
semconv import fixture so `make rules` passes.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
Remove live-API-dead File helpers kept alive only by tests/fuzz.
Delete unreachable ValueSpec ok-check and parseVersion i>2 break.
Add focused tests for policy load errors, render write failures,
normalizeEngine(""), extras sort, and a few resolve edge cases.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
Unchecked assert fails golangci; branch stays defensive and uncovered.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
WalkDir reports ModeSymlink without ModeDir, so IsDir is always false
here; one skip covers file and directory symlink entries.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
Cold-cache `go: downloading` lines were merged into stdout via 2>&1 and
falsely failed the non-empty deadcode check in CI. Pin GOTOOLCHAIN from
go.mod so GOTOOLCHAIN=local on an older host go still selects the module line.

Co-authored-by: Bartłomiej Piekarz <Pieczasz@users.noreply.github.com>
@Pieczasz
Pieczasz marked this pull request as ready for review September 19, 2026 10:49
@Pieczasz
Pieczasz merged commit 6b92d8e into main Sep 19, 2026
4 checks passed
@Pieczasz
Pieczasz deleted the cursor/tar-47-63-policy-semconv-8703 branch September 28, 2026 10:52
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