release: explicit metrics (ASA-794) and add-as-keyword target ad groups (ASA-799) - #24
Closed
adressop6789-max wants to merge 8 commits into
Closed
adressop6789-max wants to merge 8 commits into
adressop6789-max wants to merge 8 commits into
Conversation
Collaborator
Author
|
Superseded by #25 — same tree, rebuilt on a cleanly named branch. |
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.
Release branch combining the two open feature PRs for a single merge into
main, plus a patch version bump.Supersedes #22 and #23 — both carry the same commits as this branch, so close them without merging once this lands, or
maingets each commit twice.feature/ASA-794-explicit-metricsd91200f,f78c5e9feature/ASA-799-automation-target-ad-groupsca8c303,7bc17a5,f5b636fASA-794 — explicit metrics and scope flags
asa metricsno longer defaults to every metric:--metricis now required, because every metric named is computed over the whole entity set.subscribersandpaid_subscribers— andarppu/arpas, which derive from them — count unique profiles per entity and cost roughly seventeen times the rest, so they are refused unless--campaignor--ad-groupscopes the call. The new--app/--campaign/--ad-groupscope flags are also the cheapest way to make any metrics call fast, since cost follows the number of entities aggregated rather than the page size.docs/agent/asa-metrics.mddocuments the guard for every entity.ASA-799 — target ad groups for the add-as-keyword action
A customer created 43 automation rules through
asa automations create --file rule.json; every one came out as "Add as keyword (EXACT) to 0 ad groups". Their storedparamswere theadd-as-negative-keywordshape ({"target_type": ..., "ids": [...]}) applied to anadd-as-keyword-toaction. Server-sideparamsis a pydantic union with no discriminator: it matched the foreign shape, kepttargets.ids, and silently droppedcpt_bid,match_type,negateandskip_enable_duplicate_keywords. The target ad group was correct all along — its id just landed intargets.idsinstead oftargets.internal_ids. Every call answered200.The shape was copied off a neighbouring
add-as-negative-keywordrule of the same company, where those exactparamsare valid. There was nothing to check against: therule.jsonschema was documented nowhere.So this adds flags that assemble a correct body without hand-written JSON —
--target-ad-group(repeatable),--match-type,--cpt-bid-type,--cpt-bid,--negate/--no-negate,--skip-enable-duplicates,--pause-original— on bothcreateandupdate. Which flags apply follows the rule'soperate_with, and a mismatch exits2instead of being silently mis-resolved.--cpt-bid-typeand--match-typehave no default here or in the API, so the CLI demands them rather than guessing at a spend and a reach decision. Onupdatean action flag becomes a read-modify-write that rebuildsparamsfrom scratch and writes the wholeactionslist back, which is what repairs the rules already created. The schema now lives in the README,docs/agent/asa-management.md,skills/adapty-cli/references/cli-commands.mdand the agent playbook, which gains a harvester recipe, a repair recipe, and this bug in "what the failed sessions did wrong".Server-side validation (
422on a wrongparamsshape) is a separate change inasa-analyticsand is not a dependency.Version
0.8.2→0.8.3. No tag created — that belongs onmainat release time vianpm version.Merge
Both branches merged into a branch cut from
origin/main,--no-ff. No conflicts: ASA-794 and ASA-799 both touchsrc/lib/asa-flags.tsandtest/commands/asa-writes.test.ts, but in different places, so the auto-merge is textual only. Verified as an exact union — the diff of this branch againstfeature/ASA-794-explicit-metricscontains only ASA-799's files, and againstfeature/ASA-799-automation-target-ad-groupsonly ASA-794's.Both features confirmed live in the combined build:
asa metricswithout--metricfails withMissing required flag metric, and all six action flags show up onasa automations update --help.pnpm testexits1overall on my machine, but not from the tests: itsposttestrunspnpm lint, and eslint takes its ignores from.gitignoreonly, so it walks into a local.claude/worktrees/git worktree and lints its builtdist/. Unrelated to this branch — happy to add.claude/to.gitignoreseparately if CI trips on it.