Skip to content

Release 1.8.0: owner attribution, abstention transparency, and self-update - #20

Merged
sting8k merged 8 commits into
mainfrom
us-072-c-cpp-owner-attribution
Sep 3, 2026
Merged

sting8k merged 8 commits into
mainfrom
us-072-c-cpp-owner-attribution

Conversation

@sting8k

@sting8k sting8k commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Extends 1.6.0 owner attribution from 8 to 11 languages for discover --match any --as text hits.

Wave 1 — C/C++ (4ace457)

  • Shared Lang-parameterized adapter src/evidence/owners/c_cpp.rs.
  • C: ANSI function definitions; K&R-style definitions abstain.
  • C++: namespace/class qualification (ns::Class::method), out-of-line qualified declarators, transparent templates, lambda barriers, type-less ctor/dtor gate bound to lexical classes (never namespaces).
  • Macro-generated definitions (e.g. TEST(...)) never become owners; qualified identifiers with direct ERROR/missing children abstain.

Wave 2 — Ruby (df01133)

  • Adapter src/evidence/owners/ruby.rs; display distinguishes instance A::B#m from singleton A::B.m.
  • Qualified class/module paths are authoritative: longest lexical-suffix/qualified-prefix witness merges (module A; class A::BA::B); disjoint composition barriers instead of fabricating unprovable owners (Ruby Module.nesting resolution is not provable from single-file syntax, unlike C++'s enclosing-namespace constraint); leading :: is absolute.
  • One-level class << self with state reset on named-container entry; higher-order eigenclass forms barrier.
  • Ordinary blocks/procs/lambdas transparent to the enclosing method; 13 dynamic metaprogramming constructs (define_method, define_singleton_method, eval/exec families, alias forms, attr_*) are full barriers.

Shared invariants

  • Fail-closed: every identity-fail or error-degraded path emits a full-range anonymous barrier before descending; nested definitions never leak recovered owners.
  • Anti-drift manifests pin bundled C/C++/Ruby NODE_TYPES fingerprints with explicit per-kind dispositions.
  • Owner-only dispatch: C/C++/Ruby never enter call-edge analysis; the mechanical call appendix remains Go-only.

Verification

  • Full cargo test --locked green (54 suites), clippy -D warnings, fmt --check.
  • Real-repo smoke: radare2 (C macros/#ifdef), Ghidra decompiler (out-of-line C++), Ghidra unittests (TEST() must-abstain), CoreCLR (SAL ERROR-cascade degrade), fmt (macro-dense fail-closed), sinatra + activesupport (metaprogramming hazard sweep: 0 fabricated owners; module ::HelperOne root-replacement case caught live).
  • Two-round independent code review; 3 P1 fabrication defects found and fixed pre-merge with regression repros.
  • Windows CI required on this PR before merge (owner dispatch, path/range rendering, replay determinism).

Docs (GUIDE/README/CHANGELOG language matrix) intentionally deferred to the release-prep commit per repo convention.

US-073 — Typed abstention transparency (e40e410)

  • Text OR output now distinguishes three owner states without a new flag: named (existing lines byte-for-byte unchanged), analyzed-but-abstained (one aggregate line per affected file: owners: none — abstained (...) / owner abstentions: ... with reasons parse-failed, error-line, barrier, top-level, tie in canonical order), and unsupported (silent).
  • Typed decision lives at the shared attribute_line seam; all 13 routed owner Lang variants flow through it — adapters changed only mechanically (return type).
  • Go parity: same visible states; FileAnalysis, attempted-analysis gating, owner thresholds, and call edges remain success-only and Go-only.
  • GUIDE corrected: owner rollup is multi-language (was documented Go-only); documents silence-vs-abstention and that top-level is a lexical position, not an importance judgment.

operator() fix (dd7005f)

  • Greptile P1 resolved: valid C++ operator() definitions (inline, const, out-of-line, namespace-qualified) now attribute owners; terminal_text paren allowance is bounded to destructor_name/operator_name. Known pre-existing gap: operator, spelling still abstains.

Baseline note: cargo clippy --all-targets carries 25 pre-existing warnings unrelated to this PR; the standard clippy gate is clean.

US-074 — Installation-aware self-update (e8e0ff2)

  • Adds srcwalk update [--check]; compatibility version --check routes through the same strict three-state version decision and points to srcwalk update.
  • Resolves latest without GitHub API through bounded HTTPS curl/wget fallbacks, then npm registry/npm CLI fallbacks; plain version and navigation commands remain offline.
  • Detects npm/pnpm/yarn/bun installs, prints and executes the fixed global update command, and verifies the resulting binary version.
  • Standalone/cargo installs download the matching release asset and filename-bound SHA-256, validate the one-binary archive, then use same-directory transactional replacement with rollback and post-check.
  • Mirrors npm release targets, including Windows x86_64 and ARM64-to-x64 emulation; Windows running-image behavior is covered by a disposable-copy CI test.
  • README, GUIDE, CLI help, npm installer fixture, Cargo metadata, and 1.8.0 changelog are aligned.

Local verification at e8e0ff2: cargo test --locked (1474 passed, 1 ignored), standard clippy/fmt/diff gates, npm installer tests, and npm pack dry-run all clean. Commit 64168df only applies three Rust 1.98 clippy-equivalent rewrites required by CI.

Add a shared Lang-parameterized adapter (src/evidence/owners/c_cpp.rs)
wired into the owner-only dispatch, extending 1.6.0 owner attribution
to C and C++ discover --match any --as text hits.

- C: ANSI function definitions; K&R-style definitions abstain.
- C++: namespace/class qualification (ns::Class::method), out-of-line
  qualified declarators, transparent templates, lambda barriers,
  type-less ctor/dtor gate bound to lexical classes (never namespaces).
- Fail-closed: every failed or abstained function identity emits a
  full-range anonymous barrier before descending, so macro-generated
  (e.g. TEST(...)) and malformed definitions cannot leak nested owners;
  qualified identifiers with direct ERROR/missing children abstain.
- Anti-drift manifests pin bundled C/C++ grammar NODE_TYPES fingerprints.
- Call appendix remains Go-only; C/C++ files never enter call-edge
  analysis.

US-072. Spec by Biscuit, implementation by Bella, code review by
Biscuit (v1 rejected with 2 P1 fail-closed leaks, v2 approved),
final gate by Milo.
Add a Ruby adapter (src/evidence/owners/ruby.rs) wired into the
owner-only dispatch, extending owner attribution to Ruby
discover --match any --as text hits (US-072 wave 2).

- Named owners from grammar method/singleton_method nodes only;
  display distinguishes instance (A::B#m) from singleton (A::B.m).
- Qualified class/module paths are authoritative: longest
  lexical-suffix/qualified-prefix witness merges (module A +
  class A::B -> A::B); disjoint composition barriers instead of
  fabricating unprovable owners (Ruby Module.nesting resolution
  cannot be proven from single-file syntax, unlike C++'s
  enclosing-namespace constraint); leading :: is absolute and
  replaces the lexical stack.
- class << self supports one singleton level with state reset on
  named-container entry; higher-order eigenclass forms barrier.
- Ordinary blocks/procs/lambdas are transparent to the enclosing
  method; 13 dynamic metaprogramming constructs (define_method,
  define_singleton_method, eval/exec families, alias forms,
  attr_* accessors) are full barriers and never named owners.
- Fail-closed: every identity-fail or error-degraded path emits a
  full-range anonymous barrier before descending.
- Anti-drift manifest pins the bundled Ruby NODE_TYPES fingerprint.
- Call appendix remains Go-only; C/C++ wave 1 (4ace457) unchanged.

US-072 wave 2. Spec by Biscuit, implementation by Bella, code review
by Biscuit (v1 rejected with P1 fabricated-qualification + P2
absolute-path gap, v2 approved), disjoint-composition arbitration and
final gate by Milo.
@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown

Greptile Summary

The PR extends structural owner attribution to C, C++, and Ruby, adds typed owner-abstention reporting, and introduces installation-aware self-update support.

  • Adds fail-closed owner adapters and manifests for C, C++, and Ruby.
  • Reports analyzed owner abstentions while leaving unsupported languages silent.
  • Adds update checking, installation-channel detection, verified standalone replacement, and associated CLI tests and documentation.
  • Repairs C++ operator() attribution for inline, qualified, const, and out-of-line definitions.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the prior C++ call-operator attribution issue is covered for inline, const, out-of-line, and namespace-qualified definitions.

Important Files Changed

Filename Overview
src/evidence/owners/c_cpp.rs Adds fail-closed C/C++ owner attribution and correctly repairs the previously reported operator() ownership gap with focused coverage.
src/evidence/owners/ruby.rs Adds qualified Ruby owner attribution with explicit barriers for dynamic and structurally unprovable constructs.
src/evidence/owners/mod.rs Introduces shared typed owner decisions and routes the expanded language set through the attribution seam.
src/commands/find.rs Integrates bounded per-file abstention reporting into text-OR discovery output.
src/update.rs Implements installation-aware update resolution, integrity verification, transactional replacement, and rollback behavior.
src/cli.rs Adds the update command surface and compatibility routing for version checks.
tests/update_command.rs Covers update decision states, package-manager routing, standalone replacement, and platform-specific behavior.

Reviews (7): Last reviewed commit: "fix: compile self-update on Windows" | Re-trigger Greptile

Comment thread src/evidence/owners/c_cpp.rs
terminal_text rejected parentheses in every operator_name spelling, so
complete operator() definitions were degraded to anonymous barriers and
lost their structural owner evidence (Greptile P1 on PR #20). The helper
only ever reads destructor_name/operator_name nodes; plain identifiers
remain protected by identifier_text, so allowing parens is bounded to
operator spellings.

Adds unit coverage for inline, const, out-of-line, and namespace-
qualified operator() plus CLI integration incl. non-Go isolation.
Known remaining gap: operator, (comma operator) spelling is still
rejected by the comma guard; pre-existing, out of scope.

US-072 follow-up. Fix by Luna, review by Waffle, final gate by Milo.
Text OR output now distinguishes three owner-attribution states
without a new flag: named owners render unchanged (byte-for-byte),
analyzed-but-abstained files report parser-known reasons once per
file, and languages without an owner analyzer stay silent.

- Shared seam: attribute_line returns typed OwnerAttribution
  (Named | Abstained) with five reasons — parse-failed, error-line,
  barrier, top-level, tie — under a fixed precedence; all routed
  owner languages flow through the shared decision, adapters only
  adapt mechanically to the new return type.
- Supported-language parse rejection is now visible as parse-failed
  instead of being indistinguishable from unsupported languages.
- Go parity: same user-visible states; FileAnalysis, attempted-
  analysis gating, owner thresholds, and call edges remain
  success-only and Go-only.
- Transport: AbstainedTextHit beside OwnedTextHit; named-owner
  queries, equality, and edge construction unchanged.
- Rendering: compact adds one aggregate line under the affected
  file ('owners: none — abstained (...)' or 'owner abstentions:
  ...'); detailed mode adds a bounded path-sorted section; named-
  only and unsupported files gain zero lines.
- GUIDE: owner rollup corrected from Go-only to multi-language;
  documents silence-vs-abstention and that top-level is a lexical
  position, not an importance judgment.

Known baseline note: cargo clippy --all-targets carries 25
pre-existing warnings unrelated to this change; the standard
clippy gate is clean.

US-073. Spec + review by Waffle, implementation by Luna, user
acceptance and final gate by Milo.
@sting8k sting8k changed the title US-072: structural owner attribution for C, C++, and Ruby US-072 + US-073: owner attribution for C/C++/Ruby and typed abstention transparency Aug 16, 2026
- Bump Cargo.toml, npm/package.json, Cargo.lock to 1.8.0.
- CHANGELOG 1.8.0: C/C++/Ruby owner attribution (8 -> 11 languages),
  typed abstention transparency, operator() fix, doc scope correction.
- README: owner rollup wording corrected to multi-language; call
  appendix stays Go-only.
@sting8k sting8k closed this Aug 24, 2026
@sting8k
sting8k deleted the us-072-c-cpp-owner-attribution branch August 24, 2026 05:18
@sting8k
sting8k restored the us-072-c-cpp-owner-attribution branch August 24, 2026 05:18
@sting8k sting8k reopened this Aug 24, 2026
@sting8k sting8k changed the title US-072 + US-073: owner attribution for C/C++/Ruby and typed abstention transparency Release 1.8.0: owner attribution, abstention transparency, and self-update Aug 24, 2026
@sting8k

sting8k commented Aug 24, 2026

Copy link
Copy Markdown
Owner Author

@greptileai

@sting8k
sting8k merged commit 39c6360 into main Sep 3, 2026
7 checks passed
@sting8k
sting8k deleted the us-072-c-cpp-owner-attribution branch September 3, 2026 03:25
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