Add the design spec for reaching strata-qa from Slack - #41
Draft
baonguyenNava wants to merge 1 commit into
Draft
Conversation
Issue #30 deferred the Slack bot itself, so the transport from a Slack channel to the deployed QA Lambda was never designed. Two facts force the shape: Slack's 3-second ACK deadline against a 9-90s answer, and the RESERVED_CONCURRENCY=3 spend ceiling that a shared ACK/work pool would collapse under load. Hence a thin public gateway in front of the existing IAM-only function, both from one image. Records the reasoning so the implementing PR argues about code, not architecture. Also updates the .dockerignore comment that claimed nothing under docs/superpowers was in git — this commit makes that false, and the exclusion is now a real one rather than insurance. Relates to #30 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
6 tasks
baonguyenNava
changed the base branch from
main
to
baonguyenNava/30-strata-qa-cli
July 28, 2026 22:08
Collaborator
Author
|
Note that I reviewed this plan. This plan is for if we decide that we want to have our Slack bot run through an AWS infrastructure and to run more deterministic code. It would also have very low cost, as we would be using a Lambda, which in itself has low cost, as well as running GPT-5.6 Luna. Typically, in my runs, each question is answered with $0.10 to $0.15 of spend. I believe that if our organization moves to limit cloud spending, then this would be an alternative that we could pursue to provide functionality that would come in at much lower cost. |
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.
What
Lands the approved design for answering Strata questions from a Slack channel, so the commits that follow can argue about code rather than architecture. No implementation yet.
Issue #30 built the Q&A engine and #39 deployed it, but #30 explicitly deferred "the Slack bot itself, or any other external caller/integration". This is the design for that deferred piece.
Closes #40
This targets
baonguyenNava/30-strata-qa-cli(#38) rather thanmain, because everything the spec reasons from —strata-qa/NOTES.md, the deployed function's reserved concurrency,.dockerignore— exists only on that branch. Review the diff against #38; this lands inmainbehind it.How
Two files.
docs/superpowers/specs/2026-07-27-strata-qa-slack-bot-design.mdis the design. Its shape is forced by two facts already recorded instrata-qa/NOTES.md: Slack demands an HTTP 200 within 3 seconds against an answer that takes 9 to 90, and a question costs roughly 190,000 tokens, which is why the deployed function carries a reserved concurrency of 3. Those rule out both a synchronous design and a single shared function, since three simultaneous questions would occupy every slot and starve the acknowledgements behind them, and Slack's retries would then convert load into more spend.So: a thin public gateway that verifies the Slack signature, acknowledges, and asynchronously invokes the existing function, which answers in-thread. Both deploy from the same image with different entrypoints, so they cannot drift to different commits, and the existing Function URL stays on
AWS_IAM. The function that spends money is never reachable from the internet..dockerignorehad a comment asserting that nothing underdocs/superpowerswas in git, which this PR makes false. The exclusion rule itself is unchanged; only the comment explaining it is.Test plan
python -m scripts.lint_manifest,python -m scripts.lint_docs, andpython -m scripts.build_graphall pass (MANIFEST_OK,DOCS_OK 56 docs,GRAPH_OK 56 docs). The twoGAP:lines aboutplatform-clitemplate components are pre-existing and unrelated.build_graphleaves the tree clean, confirming the new spec sits outside the corpus the graph is built from and does not perturbdocs/INDEX.mdordocs/graph.json.docs/superpowersrule in.dockerignoreis unchanged, so the spec still stays out of the Lambda image and out of the retrieval agent's search space.npm testunderstrata-qa/, since no TypeScript changed in this PR. It becomes required as soon as the implementation lands on this branch.Notes for reviewers
Review the spec, not just the diff. Once implementation starts, disagreeing with the architecture gets expensive, so this is the cheap moment to push back on the two-function split, the reaction-based progress signal, or the decision to fail closed on an empty channel allowlist.
This PR is deliberately a draft that will grow: the implementation commits land on this branch. Because the base is not the default branch,
Closes #40will not fire on merge — #40 stays open until someone closes it once the stack reachesmain.Three things in the spec are worth a reviewer's specific attention. The reserved
replyTofield inhandler.tsis deleted rather than kept, because a bare URL cannot carry the channel, thread, and message timestamp an in-thread reply needs, and it turned out to be a placeholder that guessed wrong. Retry deduplication uses Slack itself as the store, by treating analready_reactedresponse as proof the previous delivery succeeded, which avoids adding DynamoDB for one boolean. And a question dropped after 180 seconds of queueing leaves its progress reaction stuck with no explanation, which is an accepted v1 limitation rather than an oversight.#40 carries four open questions that are not blocking for review but are blocking for implementation. The long pole is workspace-admin approval to install a Slack app at Nava, which is worth starting now rather than when the code is ready.