{"uid":"cap_ZHppkbVqJ-Ya2xsWOm8qC","slug":"packing-displacement-analysis-29f8cd58","name":"Packing Displacement Analysis","description":"Compare strict rank-prefix packing with rank-order greedy-fit and score-density greedy-fit for up to 64 passages under a 1–2048 token budget. Report evidence displacement and optional observed selection violations. Uses declared integer costs/scores; no tokenization or causal attribution. New modular adapter: retained result recovery for 24 hours, minimal receipt metadata for 90 days. Existing live route unchanged.","url":"https://www.mahastrategies.com/api/v1/context/retrieval/packing-displacement?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"budget":{"type":"integer","maximum":2048,"minimum":1},"dataClass":{"enum":["public","synthetic"],"type":"string"},"candidates":{"type":"array","maxItems":64,"minItems":1},"requiredEvidenceIds":{"type":"array","maxItems":64,"minItems":1},"observedSelectedPassageIds":{"anyOf":[{"type":"array","maxItems":64,"minItems":0},{"type":"null"}]}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.075","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.075/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.075","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.075","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_I36yIUKGqTQEPZWAKYck2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.075","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares three context-packing strategies (rank-prefix, rank-order greedy-fit, score-density greedy-fit) for up to 64 passages under a token budget, reporting evidence displacement and selection violations.","exampleAgentPrompt":"Can you run a packing displacement analysis on my 12 candidate passages with a 512-token budget, marking passage IDs P1, P3, and P7 as required evidence, and using synthetic data class — I want to see which packing strategy displaces my required passages the least?","exampleUseCases":[{"title":"RAG pipeline packing audit","prompt":"I have 20 candidate passages and a 1024-token budget for my RAG system — can you compare rank-prefix, rank-order greedy-fit, and score-density greedy-fit packing strategies and tell me which ones displace my required evidence passages P4, P9, and P15? Data is synthetic."},{"title":"Detecting selection violations in retrieved context","prompt":"I've got an observed set of selected passage IDs from my retrieval system and want to check if they violate expected packing behavior — run a displacement analysis on my 30 candidates under a 768-token budget with observed selections [A1, A2, A5] and required evidence IDs [A1, A3], using public data class."},{"title":"Optimizing token budget for evidence retention","prompt":"Can you analyze packing displacement for 8 candidate passages under a tight 256-token budget and tell me which packing algorithm best retains my two required evidence passages E2 and E6? Use synthetic data class."}],"resultDescription":"Returns a comparison of three packing strategies (rank-prefix, rank-order greedy-fit, score-density greedy-fit) showing which passages are displaced under the given token budget, evidence displacement metrics for required passages, and optional selection violation flags if observed selections are provided. Results are retained for 24 hours; receipt metadata retained for 90 days.","failureModes":["Budget out of range (must be 1–2048): returns validation error","More than 64 candidates or required evidence IDs supplied: returns schema validation error","Invalid dataClass value (must be 'public' or 'synthetic'): returns enum validation error","Missing required candidates array: returns 400 bad request","Required evidence IDs not present in candidates list: may return displacement report showing 100% displacement or an error"],"whenToPreferThis":"Choose this endpoint when you need to analytically compare how different context-packing algorithms handle evidence retention under a fixed token budget — specifically when you have declared integer costs and scores and want to audit displacement without tokenization or causal attribution. Prefer this over generic ranking or retrieval endpoints when the goal is to understand packing strategy trade-offs and detect selection violations in an existing retrieval pipeline.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-16T12:44:04.631Z","isFirstParty":false,"canonicalSlug":"packing-displacement-analysis-248123c1"}