Repository navigation
Conversation
|
@araujof Can you share your feedback on the design. |
Signed-off-by: Sai Sree Laya Chukkappalli <saisreelaya.chukkapalli@gmail.com>
3719082 to
295bde0
Compare
|
Hi @iamsreec, Overall, I think this is pretty good. A few things I would recommend:
Findings1. Rebase onto 2. The Phase C query is built from the table Phase C is writing. §6 says queries are "built from validated artifact fields, not model prose", and Phase C queries use 3. No evidence yet that the current approach falls short. The numbers in §2 are catalog and token sizes, not retrieval quality. The motivating example (T1 classed ASI01 with its real mitigations in ASI03 and ASI02) is a judgement that §10 step 3 plans to confirm later. 11 to 15K tokens is not large for current models. Could §9 add a baseline: the same threats run through Phase D with and without augmentation, scored against the same labels? Without it, recall@k shows that retrieval finds relevant items but not that Phase D would otherwise have missed them. 4. The evaluation set is one example. Thresholds tuned on hr-agent's 14 threats will likely fit hr-agent. Labelling a second example from the other four and checking that 5. The N/A pre-screen could anchor the model. It is described as a hint only, but showing the model a scenario as probably N/A pushes it toward that answer. The §9 gate measures whether the screen separates threat-cited scenarios from N/A ones, not whether the hint changes the model's dispositions. How would that be tested? If there is no good answer, shipping step 7 and leaving step 8 open seems the safer scope. 6. Final ordering after merging queries is unspecified. The bounding order is top_k per query, min_score, dedupe by max score, then Nits
|
|
@terylt, Thank you for sharing the feedback. Modified the sketch based on it. |
Signed-off-by: Sai Sree Laya Chukkappalli <saisreelaya.chukkapalli@gmail.com>
Signed-off-by: Sai Sree Laya Chukkappalli <saisreelaya.chukkapalli@gmail.com>
Signed-off-by: Sai Sree Laya Chukkappalli <saisreelaya.chukkapalli@gmail.com>
araujof
left a comment
There was a problem hiding this comment.
This looks ready as a design proposal. Keeping the baseline catalog set intact while checking whether ranking changes Phase D decisions makes sense. I have two questions about the search budget and how ranked and augmented snapshots pass the freshness check.
| - **Two separate indexes** so a scenario query can never return a mitigation item — Phase C field discipline enforced structurally. | ||
| - Vectors L2-normalized, so the one surviving absolute threshold (`novel_floor`) is comparable across runs. Deterministic ordering → rebuilds are byte-identical. | ||
| - **Embedding text remains an open question.** The initial draft used `f"{entry.name}: {item_text}"` because short clauses such as *"Apply version control."* lack context. However, adding the same category name to roughly 30 items may reduce within-category separation and make cross-category comparison depend too heavily on category labels. Measure prefixed and unprefixed text before choosing a format (open question 1) and before tuning other parameters. | ||
| - **Only `search` is bounded:** apply per-query `top_k`, deduplicate by canonical ID while keeping the maximum score, then apply global `max_items` with at least one result per query. `top_k` limits candidates before deduplication; `max_items` limits total added context. The per-query floor prevents a few high-scoring threats from consuming the full budget. Results stay grouped by query and carry the originating threat (`"threat": "T12"` in §6). Phase C uses the same rule for each `Attack Surfaces` row. |
There was a problem hiding this comment.
max_items is described as a global cap, but the test at line 574 keeps one hit per query even when queries outnumber it. With distinct hits, those rules conflict. Which one wins? It would also help to state how remaining slots and ties are assigned so repeated runs get the same result.
|
|
||
| **Key invariant and regression tests:** | ||
| - **`rank` is order-only:** for every input set, output is a permutation with the same multiset of IDs. This directly tests the §3 invariant. | ||
| - Phase D's ranked snapshot contains exactly the PR 1 snapshot's items; with the index absent it is byte-identical to the PR 1 snapshot. |
There was a problem hiding this comment.
Does this exact-set assertion apply only to rank-only mode? Step 7 also writes cross-category additions into the snapshot, so the augmented version should have more than PR 1's items. The §5 freshness check compares the snapshot to the canonical projection; please spell out how it accepts reordering and additions while still catching missing or changed baseline items.
Revisiting the context-reduction goal. The spec needs smaller handoffs, context budgets and measurements of full workflow token use before approval.
araujof
left a comment
There was a problem hiding this comment.
Could we revisit section 0.1 before merging? Reducing context use was part of the reason for this proposal, but the current design makes context capacity a non-goal. Ranking keeps the same entries, and cross-category search adds more. The catalog fitting in the window doesn't tell us how much the whole analysis consumes.
I counted the saved files for the five examples with a Llama tokenizer. The architecture, questionnaire and threat model together came to about 16-35K tokens; Phase D's input files came to 26-46K before chat history, earlier source reads, output and retries. These are file counts; we still need measurements from actual runs.
Please update the spec with a plan for smaller phase handoffs, batches that don't keep accumulating in the same context, and a total context budget with room for output and retries. Keep checkpoint validation of all 61 scenarios across the batches, and spell out how retrieved additions fit within the budget. Add a comparison of peak context, total tokens and analysis quality on real example runs, and update this PR's description to match. The code can follow in separate PRs; #154 can stay focused on snapshots and provenance.
Signed-off-by: Sai Sree Laya Chukkappalli <saisreelaya.chukkapalli@gmail.com>
|
I reproduced your counts (Llama 3): A–C is 16–34K, Phase D input is 22–42K, and the catalog is only 3–7K of that. So the savings come from handoffs and batching, not the catalog. §0.1: context use is now a goal.
|
Summary
Security analysis currently loads large threat-catalog sections directly into the model context. Add a vector-backed retrieval layer that selects only the catalog entries relevant to the current architecture, attack surfaces, and analysis phase.
The complete catalog must remain the authoritative source. Vector retrieval should optimize candidate discovery without silently excluding required coverage.
Design Sketch
Changes
input, output, and one retry. The 61-scenario and every-threat-once checks still run on the merged result.
Scenario Coverage(3–4.5K) isn't used by Phase D.max_itemscomes from each batch's remaining budget and always wins; deterministic allocation with stated tie-breaks.Notes
Code follows in separate PRs. #154 stays limited to snapshots and provenance. Per-call usage logging (§9.A) is needed before PR 2's measurements.