Skip to content

refactor(python): run aggregate tools on upstream PySNC GlideAggregate#9

Merged
orwellsanimal merged 1 commit into
mainfrom
feat/aggregate-on-glideaggregate
May 29, 2026
Merged

refactor(python): run aggregate tools on upstream PySNC GlideAggregate#9
orwellsanimal merged 1 commit into
mainfrom
feat/aggregate-on-glideaggregate

Conversation

@orwellsanimal

Copy link
Copy Markdown
Owner

Summary

  • Swap the internals of sn_count / sn_aggregate (scripts/python/aggregate.py) onto client.GlideAggregate(...), removing the hand-rolled Stats API plumbing (_stats_request / _parse_stats / _group_key). Signatures and the int / dict / structured-dict return contracts are unchanged.
  • Pin pysnc to the fork branch carrying the upstream contribution (feat: add GlideAggregate (Stats API) support ServiceNow/PySNC#146) until it merges and ships in a release.
  • Dogfoods the new GlideAggregate continuously through the repo's real consumers while the upstream PR is in review.

Validation

Verified against dev392282 at the real call sites:

  • assets/summary.json — byte-identical modulo the _exported_at timestamp (model-category names + install-status labels unchanged). The display_value=trueall change in the upstream class produced identical output here.
  • distribution.json — differs only by data drift since the 2026-05-15 snapshot (total_active 639→645, unclassified 627→633, both +6); structure unchanged.
  • debug-pc-auto-request.py — runs clean (active 645, identity split 633/10/1/1).
  • Earlier standalone dogfood: 6/6 parity vs the old implementation (scratch/pysnc-contribution/dogfood-findings.md).

Notes / caveats

  • The git-ref pin installs pysnc from the fork. The fork's version string is also 1.2.1, so a runner that already has a published 1.2.1 cached will report "already satisfied" and skip the git ref — a fresh install pulls it correctly. Worth keeping in mind for CI cache behavior.
  • This is the low-risk venue for the "pin to fork/git ref" approach; the production agent (whitcortex#982) stays blocked on a real release.
  • Revert plan: once GlideAggregate ships in a released pysnc, swap the git ref back to a normal version pin.

Closes #8. Refs ServiceNow/PySNC#146

Swap the internals of sn_count / sn_aggregate onto client.GlideAggregate,
removing the hand-rolled Stats API plumbing (_stats_request / _parse_stats /
_group_key) now that the capability lives upstream. Function signatures and
the int / dict / structured-dict return contracts are unchanged.

Pin pysnc to the fork branch carrying the contribution (ServiceNow/PySNC#146)
until it merges and ships in a release; revert to a version pin then.

Parity verified at the real call sites (export-runtime, debug-pc-auto-request)
against dev392282: assets/summary.json is byte-identical modulo the export
timestamp; distribution.json differs only by data drift since the last
snapshot. Earlier dogfood showed 6/6 parity vs the old implementation.

Closes #8. Refs ServiceNow/PySNC#146

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@orwellsanimal orwellsanimal merged commit 1d13436 into main May 29, 2026
5 checks passed
@orwellsanimal orwellsanimal deleted the feat/aggregate-on-glideaggregate branch June 6, 2026 00:03
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.

refactor(python): swap in-house aggregate tools onto upstream PySNC GlideAggregate (dogfood)

1 participant