Repository Discovery
Begin brownfield work by mapping entry points, packages, runtime boundaries, data stores, tests, build commands, ownership, and dependency direction. Prefer symbol-aware or repository-native search to speculative reading. Record unknown behavior as a gap rather than inventing a rule.
TaskFlow working chapter: Repository Discovery
TaskFlow is not a greenfield demonstration. It already serves multiple organizations, contains undocumented behavior, and runs background work with incomplete telemetry. This chapter changes one precise part of that system: organization-scoped audit exports. Its role in context and interoperability is to turn repository discovery into an engineering decision that survives implementation, review, release, and incident recovery. The primary deliverable is the context and tool contract package; a chat transcript or plausible code diff is not a substitute.
Decision in focus
Create an observed-behavior inventory with confidence labels. The change remains anchored to OUT-001: an organization administrator can request and download a complete audit export without learning whether another tenant's records exist. Record provenance, typed boundaries, authorization, cancellation, and untrusted output. In particular, distinguish the actor making the request, the organization used for authorization, the organization embedded in the queued job, and the organization used by the worker query. Those values should normally agree, but the design must fail closed when they do not.
The chapter's central review question is: what new fact or control does Repository Discovery contribute that the surrounding chapters do not? Answer it in the owning artifact. For this topic, reviewers must separate facts recovered from code and telemetry from inferred intent. Link the result to stable identifiers instead of copying requirements into several documents: FR-AE-001 covers authorized export creation, FR-AE-004 covers expiration, NFR-AE-002 sets the latency objective, RISK-AE-001 covers cross-tenant disclosure, and EVD-AE-* identifies retained proof.
Concrete scenario
Assume administrator Ana requests an export for organization org-a. The API authorizes Ana, writes a job containing org-a, and returns 202 Accepted with an opaque job identifier. Before the worker starts, Ana loses the administrator role. Decide explicitly whether execution uses authorization captured at request time or revalidates current authorization; document the privacy, usability, and audit implications. Next, inject org-b into the worker payload and verify that the worker rejects it without revealing whether org-b exists. Finally, retry the same job after object storage succeeds but the database status update fails. The recovery path must avoid duplicate disclosures and must leave enough evidence to reconcile the artifact.
This scenario prevents a common failure in agent-generated changes: each component looks locally reasonable while the end-to-end authority chain is inconsistent. It also forces the chapter topic to influence observable behavior. If applying repository discovery does not change an artifact, gate, test, policy, or production signal, it has not yet contributed to the lifecycle.
Verification and exit evidence
Run deterministic checks for tenant scoping, role changes, state transitions, idempotency, retention, and download authorization. Use probabilistic evaluation only where judgment is genuinely required, such as assessing whether an agent's handoff explains residual risk. Retain the specification revision, code commit, exact commands, test and eval results, reviewer identity, approvals, environment, artifact digest, and timestamp. Redact secrets and exported audit contents while retaining correlation identifiers needed for investigation.
The chapter is complete when reviewers can trace OUT-001 → FR/NFR → DEC → TASK → TEST/EVAL → EVD, reproduce the important failure cases, and explain the return path if evidence fails. send contradictions to a human decision instead of canonizing accidental legacy behavior. Any unresolved authority question, incompatible migration, or missing rollback mechanism returns to the owning specification or decision record; it does not become an implementation-time guess.
Workshop
Apply the chapter to the scenario above and produce the named artifact. Include one denied action, one approval boundary, one failure injection, one measurable production signal, and one rollback or reconciliation step. Exchange artifacts with another reviewer who has only the repository and evidence manifest. If that reviewer cannot identify the permitted authority and independently determine whether RISK-AE-001 is controlled, revise the artifact rather than adding explanatory chat.
Sources and currency
Last technically verified: 2026-08-09
Commands, product support, and preview status can change. Verify the applicable version before adopting an example as policy.