# WAR-CRAFT: Refining Web API Recommendations through Requirement Auditing

WAR-CRAFT audits and repairs Web API recommendation sets against provider documentation

Zishuo Xu, Dezhong Yao, Zhiqiang Xu · arXiv · 2026-10-31

- **Problem** Web API recommenders return API sets that nobody checks against provider documentation. The sets can hold unsupported or redundant APIs and still miss requested capabilities.
- **Method** WAR-CRAFT deletes unsupported APIs, finds missing requirements, and adds only documented catalog APIs.
- **Results** On ProgrammableWeb across seven upstream recommenders, mean SetF1 rises from 0.558 to 0.644. Functional redundancy falls from 0.127 to 0.065.

## Why a recommended API set needs a check

Web API recommenders score each API against a mashup description and return either a ranked list or a generated set. Neither form is checked against provider documentation as a whole, though that documentation is the public record of an API's abilities. Providers overlap in function, so an irrelevant or duplicated API adds integration work without adding functionality.

Under DOEM's functional labels, only 53.25% of the functions in the initial sets are required by the mashup on average. The same initial sets duplicate 12.65% of their functional provision, across the seven upstream recommenders evaluated.

Even WAR-R1, which writes rationales, leaves 8.56% of its recommended API instances without one. Another 7.53% of the APIs mentioned in its rationales are absent from its recommendation sets.

The obvious repair is to add an API for every uncovered requirement, and that repair backfires. A requirement may also have no documented provider in the catalog, so no catalog API can fill it. In the experiments, always adding the top retrieved API lowers SetF1 to 0.581, below 0.591 for filtering alone. The Resolver abstains on 69.7% of requirement-level decisions, so the add decision needs its own judgment.

The authors therefore study post-recommendation refinement, which revises the output without accessing or retraining the recommender. Each keep, remove, or add decision must be justified by the request and the API documentation. WAR-CRAFT splits refinement into three choices: deleting, detecting gaps, and adding or abstaining.

## Treating refinement as three decisions

WAR-CRAFT splits post-recommendation refinement into three decisions: delete, detect gaps, and add or abstain. The refiner works only from the request, the catalog, and provider documentation, so the frozen recommender stays untouched. Each decision has to be justified by the request and the API documentation, which keeps the revision evidence-constrained.

Filtering comes first: a Role Writer judges all candidates together and assigns each a KEEP or DELETE decision.

A DELETE needs a reason, either UNSUPPORTED or REDUNDANT, and partial overlap isn't enough to remove an API. Another retained API must fully subsume the documented mashup-relevant contribution, without losing a distinction the request needs. Additions must target request-grounded capabilities that the retained set doesn't already cover. Because of these two rules, the output size changes through deletion and addition instead of following a fixed cutoff.

Formally, the refined set is the initial set minus the deleted APIs, plus the added APIs drawn from outside the initial set. The deleted set is a subset of the initial set, and the added set is a subset of the catalog minus the initial set. Each API in the refined set carries one functional role, so the output stays traceable to the request.

The Joint Requirement Auditor then builds a checklist and marks each requirement COVERED or MISSING. Only the missing requirements go to the Resolver, which either proposes a catalog API or abstains.

## How the stages run in order

An initial set starts in the Role Writer, which jointly evaluates every candidate against the request and its full catalog description. Each candidate gets a KEEP or DELETE decision, and deletions carry a reason code of UNSUPPORTED or REDUNDANT. The retained set, which may be empty, passes unchanged to the Joint Requirement Auditor for coverage assessment.

Deleted candidates can't come back later, so the filter fixes the pool that the rest of the pipeline sees.

![Figure 2: Overview of WAR-CRAFT. The framework refines API recommendations through role writing and joint requirement auditing, invoking the Resolver and Comm…](https://refivu.com/papers/55f50616-1dd4-415c-b847-5176baf35714/figures/figure-bba66272c3e481dc5551d1a99d9e82c8.png?thumb=512)

**Figure 2** : Overview of WAR-CRAFT. The framework refines API recommendations through role writing and joint requirement auditing, invoking the Resolver and Commit Verifier only when requirements remain uncovered.

[Original paper](https://arxiv.org/abs/2611.00564v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Zishuo Xu, Dezhong Yao, Zhiqiang Xu · WAR-CRAFT: Refining Web API Recommendations through Requirement Auditing · Original paper figure · Extracted the figure area from page 4 of the original PDF.

The Joint Requirement Auditor builds an ordered checklist in one LLM call from the request and the retained APIs' descriptions and roles. Otherwise the requirement is MISSING and gets one query, reformulated for catalog resolution, with requirements and queries kept provider-neutral. If no requirement is missing, the Auditor returns COMPLETE, and the Resolver and Commit Verifier are skipped so the retained set is the output.

Otherwise the Auditor returns RESOLVE\_BATCH with all missing items, and a deterministic validator checks them before resolution.

The Resolver receives each missing item along with the retained set and the initial API tokens, which are labeled KEEP or DELETE. All tokens for the initial candidates are removed from the action space, so the Resolver can only pick a new catalog API or \<NO\_ADD\>. Abstentions are discarded, and the remaining API proposals are deduplicated into the candidate addition set.

The Commit Verifier checks each distinct proposed API against its catalog description, with the request and all of its originating queries, in one LLM call. An API is ACCEPT if at least one originating query is judged SUPPORTED, and REJECT otherwise. Accepted APIs get one functional role each, and the final set is the retained set merged with the accepted additions.

## Choosing a catalog API or abstaining

The Resolver gives every documented catalog API its own action token, plus one NO\_ADD token for abstaining. Tokens of all initial candidates, whether kept or deleted, leave the active action space, so a deleted API can't return. At decoding time, the Resolver masks every token outside that space and takes the highest-scoring eligible action.

It picks NO\_ADD when a separate API isn't needed or when no eligible catalog API covers the queried capability.

Training examples come from reviewed requirement–API pairs in training mashups, plus short functional anchors for catalog APIs. When several APIs satisfy the same atomic requirement, all their action tokens count as valid positives. The multi-positive loss raises the total probability on valid actions, and with one positive it reduces to cross-entropy over the active actions.

The retained supervision has 3,434 API-action states, 310 with multiple valid targets, and 3,946 NO\_ADD states.

The Resolver is fine-tuned from Llama-3.2-3B-Instruct with LoRA, and its action-token embeddings start from API names and descriptions. A hit counts any valid target action as correct.

Most gaps therefore never become additions, so abstaining is the usual result for this component. Ret-Abstain replaces only the Resolver with a Tool-Embed-4B retriever that scores APIs beside a learned no-add candidate.

## Checking additions and writing roles

The Commit Verifier exists because the Resolver only confirms that a proposal is in the catalog, not that its documentation supports the need. The Resolver neither reads API descriptions at decision time nor generates functional roles, so a separate check is needed. For each distinct API in the candidate set, the Verifier receives the request, that API's description, and all queries that proposed it.

It sees all of those queries in one LLM call, with API names withheld, and uses only the description as evidence of support.

The Verifier judges each query separately, labeling it SUPPORTED when the description directly supports the entire atomic capability. A query that fails this test is labeled UNSUPPORTED, and the Verifier attaches a brief rationale based on the description. An API is accepted when at least one of its originating queries is SUPPORTED, so acceptance doesn't require support for every query.

Rejected proposals are dropped, which keeps a catalog-valid but poorly documented API out of the final set.

When several queries are supported, the role uses one representative contribution, and the other judgments stay in the audit trace. The final set is the kept set plus the accepted additions, with exactly one functional role per API.

In the full WAR-CRAFT run, the Commit Verifier rejected 4.6% of the 2,889 deduplicated proposals per run. Mean SetF1 moved only from 0.6443 to 0.6444 after verification, so the Verifier mainly screens documentation and writes roles. Human annotators also found that the share of reference requirements fully supported rose from 55.2% to 62.5% on 139 random traces.

## Does refinement beat the upstream sets?

The authors ran one fixed configuration over seven upstream recommenders, scored on 1,643 test mashups. Four ranking recommenders supply top-2 initial sets: WARBERT, CVH-REC, MARS, and Tool-Embed-4BFT. The three generative sources are LLMAR, WAR-R1, and zero-shot GPT-5.6 Sol, and WAR-CRAFT refines their generated sets as they come.

The 95% paired-bootstrap interval runs from 8.01 to 9.28 points, so the average gain is not a small-sample accident. Each source's interval excludes zero, so the improvement holds for every upstream set on its own. The gain is +6.88 to +18.22 points for the four ranking sources, against +2.22 to +2.38 points for the generative ones. The size of the gain therefore depends on what the upstream method returns, because the ranking sources start from fixed top-2 lists.

![Table 1: Results on 1,643 test mashups. +W AR-CRAFTdenotes the final outputs. Metrics are macro-averaged over mashups; Mean reports the average across seven so…](https://refivu.com/papers/55f50616-1dd4-415c-b847-5176baf35714/figures/figure-66269d7ae9fe69af42d692d8bcf4eb0a.png?thumb=512)

**Table 1** : Results on 1,643 test mashups. +W AR-CRAFTdenotes the final outputs. Metrics are macro-averaged over mashups; Mean reports the average across seven sources. Cov. and Eff. denote functional Coverage and Efficiency, CovF1 their per-mashup harmonic mean, and Red. functional Redundancy (↓). Bold marks the better quality score within each pair.

[Original paper](https://arxiv.org/abs/2611.00564v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

Mean CovF1 rises from 0.4479 to 0.4715, and Efficiency improves for all seven sources. Mean Coverage moves by only +0.34 percentage points, with decreases for CVH-REC and Tool-Embed-4BFT. GPT's redundancy rises, which the authors attribute to shared functional labels that inflate ratios in small sets.

## Is the gain just a size effect

The authors ask whether matching list sizes explains the refinement gains, since 53.8% of test mashups have one recorded API. Two controls cut each upstream list to a target length, either the WAR-CRAFT output size or the recorded size. Ranking sources are cut from their top-10 lists, while generated sources are cut from their original outputs.

Shorter lists stay intact, and the exact-size comparison keeps only instances with enough candidates.

On eligible instances, which make up 93.7% of cases on average, WAR-CRAFT beats equal-length prefixes. The mean gain is 4.14 SetF1 points, with a 95% paired-bootstrap interval of \[3.61, 4.67\]. Truncation to the recorded size reaches 0.6240, still below WAR-CRAFT's 0.6444. That oracle keeps more APIs on multi-API mashups, 2.71 versus 1.93, so it uses a larger set.

![Table 2: Set size versus membership, averaged over seven sources. Results include instances without enough candidates for exact size matching. Cov., CovF1, and…](https://refivu.com/papers/55f50616-1dd4-415c-b847-5176baf35714/figures/figure-bb70d4e9fa4589e6780e1c1d924799f6.png?thumb=512)

**Table 2** : Set size versus membership, averaged over seven sources. Results include instances without enough candidates for exact size matching. Cov., CovF1, and \|𝑆\| are on\|𝑌𝑖\|≥ 2. The oracle uses recorded sizes and is excluded from bolding.

[Original paper](https://arxiv.org/abs/2611.00564v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

On multi-API mashups, the eligible fraction is 92.2%, with a mean gain of 4.22 points. The 95% interval for that gain is \[3.54, 4.89\]. Truncation to the WAR-CRAFT size drops multi-API SetF1 to 0.5126, just under Initial's 0.5137, while WAR-CRAFT reaches 0.5557. Coverage follows the same pattern: truncation falls to 0.4423, while WAR-CRAFT rises to 0.4835 against 0.4699 for Initial.

The authors read these results as evidence that set size alone does not explain the gains. Single-API mashups show the same pattern, with WAR-CRAFT at 0.7206 against 0.6767 for truncation. For the single-API group, the oracle reaches 0.7105, below WAR-CRAFT's 0.7206.

## Against independent refiners and controlled variants

WAR-CRAFT leads on mean SetF1 by 1.92 points, with a 95% CI of \[1.26, 2.60\]. Tuned-k, MMR-Cut and DPP-Cut cut set size and redundancy, but they pull CovF1 below Initial's 0.4479. R&S raises CovF1 to 0.4631 but lowers SetF1 from Initial's 0.5580 to 0.5334. PTR-Refine gains 0.45 points of SetF1 over Initial and makes 2.71 GPT calls per mashup.

The ranking flips with set type, because DPP-Cut reaches 0.7355 SetF1 on single-API mashups. That is above WAR-CRAFT's 0.7206 on the same mashups. On multi-API mashups, DPP-Cut falls to 0.4967, below Initial's 0.5137. LLM-Select trails WAR-CRAFT on the four ranking sources, at 0.5759 against 0.6256 SetF1.

Direct-Edit reaches 0.6092 SetF1 with 1.22 GPT calls per mashup, while WAR-CRAFT uses 2.23. Self-Check adds a review call and lowers SetF1 to 0.6054, so it doesn't improve Direct-Edit. Separated scores 0.6250 SetF1 but makes 3.20 calls per mashup, the most of any variant. In one trace, Direct-Edit keeps both Google Maps and Google Street View Image, while the Role Writer keeps only Google Maps.

Ret-Abstain replaces the Resolver with a Tool-Embed-4B retriever, using the same supervision and action mask. It reaches 0.6174 SetF1 and trails WAR-CRAFT on all seven sources by a mean 2.70 points. The Verifier rejects 24.0% of its proposals, against 4.6% for the Resolver.

## What each stage adds to SetF1

The Role Writer is the first stage, and it filters the initial set before any coverage check runs. On its own, it raised mean SetF1 from 0.5580 to 0.5911 and cut Redundancy from 0.1265 to 0.0485. Excluding empty outputs, the Redundancy figure is 0.0520, so the cut holds even without those mashups. Coverage fell from 0.4493 to 0.4036, and CovF1 dropped from 0.4479 to 0.4396, so filtering buys compactness at a cost.

The SetF1 gain concentrates in the four ranking sources, at +4.96 to +6.96 percentage points.

The Joint Requirement Auditor and Resolver come next, and they add back the coverage that filtering removed. Together they raised mean SetF1 to 0.6443 across all seven sources. Mean Coverage returned to 0.4532, close to the initial 0.4493, while CovF1 rose to 0.4715. The Resolver returned NO\_ADD for 69.7% of the queries it received, so most gaps produced no addition.

Commit verification barely moves the scores, so its effect is measured mostly by what it screens out. Averaged over three runs, the Verifier rejects 4.6% of the 2,889 deduplicated proposals per run. Mean SetF1 changes only from 0.6443 to 0.6444, and CovF1 stays at 0.4715. The Verifier's main value is therefore documentation-based screening and functional roles, not a large SetF1 gain.

The human audit checks requirement-level support on 139 assessable random traces, not on the full test set. Over the same traces, unsupported API instances fell from 26.8% to 7.8%.

## How good the functional roles are

It rates mashup alignment, API grounding, and role clarity from 0 to 2 each. The Functional Role Score (FRS) is the normalized sum of those three ratings.

WAR-CRAFT's final roles reach a mean FRS of 0.9423 across the seven sources. The per-dimension means are 0.9451 for alignment, 0.9232 for grounding, and 0.9587 for clarity. Grounding is the lowest dimension for all seven sources, while clarity is the highest for six of them. Source-level FRS runs from 0.9296 for WARBERT to 0.9589 for Tool-Embed-4BFT.

Zero scores for empty outputs pull the zero-inclusive mean down to 0.9115.

The authors scored WAR-R1's rationales with the same judge, changing only the prompt word from role to rationale. WAR-R1's rationales reach 0.9125 on recommended APIs that have one, while WAR-CRAFT's refined outputs score 0.9521 for that source. Since 8.56% of WAR-R1's recommended API instances lack rationales, scoring those as zero drops its FRS to 0.8471.

Two authors rated 350 API-role instances, 50 per source, without knowing the source. The judge matched the consensus exactly on 89.71% to 91.14% of ratings, with Gwet's AC2 between 0.963 and 0.974. Most consensus ratings sit at the top of the scale, with 89.90% of dimension ratings at the maximum score.

## Does the initial cutoff change the gain

The authors ask whether the gain depends on how many top-ranked APIs start the refinement. They varied the initial cutoff K over 1, 2, 3 and 5 for the four ranking sources, keeping the refinement configuration fixed. Each result averages three runs, and the four ranking sources are WARBERT, CVH-REC, MARS and Tool-Embed-4BFT.

WAR-CRAFT's SetF1 exceeded the corresponding Initial in all 16 source-cutoff settings, by 1.25 to 30.56 percentage points. The gains grow as K rises, yet final SetF1 peaks at K of 1 or 2. From K of 1 to K of 5, final SetF1 drops by 2.28 to 9.57 points.

CovF1 stays above its K of 1 value at every larger cutoff, gaining 0.76 to 2.92 points at K of 5. Redundancy and final set size also rise as K grows. Stage analysis shows that more initial APIs survive filtering at larger K. Accepted additions fall by 46.2 to 75.2% from K of 1 to K of 5 across sources. So the larger final sets keep more initial APIs, not more added ones.

The sweep stops at K of 5, so larger cutoffs go untested. The generative sources sat outside this sweep, since they keep their generated sets.

## Limitations of WAR-CRAFT's refinement

WAR-CRAFT runs one refinement pass and doesn't re-audit its final set. A composite query can stay unresolved when the Auditor doesn't decompose it into atomic requirements. The Resolver picks at most one API per query, so a query that needs two APIs gets only one.

That check and the withholding of API names don't rule out memorization.

Historical API sets and coarse functional labels can't fully judge valid alternatives. The authors point to broader expert annotation of acceptable APIs for each requirement as the fix. All experiments use the ProgrammableWeb corpus, with 8,217 mashups and 1,647 APIs. The mashups were randomly split once into 4,930 training, 1,644 validation, and 1,643 test instances.

The authors didn't test other corpora, so their results stay tied to this benchmark.

## Paper info

- **Authors**: Zishuo Xu, Dezhong Yao, Zhiqiang Xu
- **Venue**: arXiv · Preprint
- **First published**: 2026-10-31
- **Added**: 2026-11-3
- **Updated**: 2026-10-31
- **Version**: v1
- **arXiv**: 2611.00564
- **Category**: cs.AI
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.00564v1) · [PDF ↗](https://arxiv.org/pdf/2611.00564v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Web API recommenders return a set of APIs for a mashup request but do not check it against provider documentation, the main public evidence of an API's capabilities. The set can therefore contain unsupported or redundant APIs and miss requested capabilities. Filling every apparent gap does not fix this, because a gap may already be served, may not need its own API, or may have no documented provider. We study post-recommendation refinement, which revises a frozen recommender's output using only the request, the catalog, and provider documentation. We propose WAR-CRAFT, which treats refinement as three decisions. An LLM removes unsupported or subsumed APIs by judging candidates jointly, then audits the remaining set against a requirement checklist derived from the request. For each uncovered requirement, a fine-tuned catalog-constrained Resolver proposes a catalog API or abstains, and an independent documentation check admits only supported proposals. On ProgrammableWeb with 7 heterogeneous upstream recommenders, WAR-CRAFT raises mean SetF1 from 0.558 to 0.644, above the strongest of 5 refinement baselines (62.5%), and roughly halves functional redundancy (0.127 to 0.065) without changing mean functional coverage. Gains range from +2.2 points on generative recommenders to +18.2 on fixed-cutoff rankers. At matched set sizes, WAR-CRAFT still outperforms truncating the upstream output, so the gain is not explained by set-size calibration alone. Our code is available at https://github.com/ZsXu-enrico/WAR-CRAFT.

## Quote from the paper

Zishuo Xu, Dezhong Yao, Zhiqiang Xu (2026). WAR-CRAFT: Refining Web API Recommendations through Requirement Auditing. arXiv:2611.00564v1. https://arxiv.org/abs/2611.00564v1

**BibTeX**

```
@misc{xu2026craft,
  title = {{WAR-CRAFT: Refining Web API Recommendations through Requirement Auditing}},
  author = {Zishuo Xu and Dezhong Yao and Zhiqiang Xu},
  year = {2026},
  eprint = {2611.00564},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.00564v1}
}
```

## Other paper commentary

- [Generative Forecasting from Coarse-Grained Observations: When Does Cascading Help?](https://refivu.com/en/papers/8c440be3-bfbd-4f0b-9b14-5f4445b5d4c0-generative-forecasting-from-coarse-grained-observations-when.md)
- [Tight Stochastic Sequential Covers for General VC Classes with Unknown i.i.d. Features](https://refivu.com/en/papers/d3f48227-9ff3-4857-8e94-60662a3e851a-tight-stochastic-sequential-covers-for-general-vc-classes.md)
- [OPINE: Orthogonal Projection in Invertible Nonlinear Embeddings for Turbulent Flows](https://refivu.com/en/papers/7540a594-7b15-4906-a880-450bc113d870-opine-orthogonal-projection-in-invertible-nonlinear.md)
- [Quantifying Local and Global Fidelity of Nonlinear Embeddings](https://refivu.com/en/papers/f63f7e4a-99ff-4ecc-b89c-fa17b7a99aa2-quantifying-local-and-global-fidelity-of-nonlinear.md)
- [Differentially Private Synthetic Data from Sliced Chebyshev Moments](https://refivu.com/en/papers/a813c721-ef49-442d-a8c1-f121f1b7f603-differentially-private-synthetic-data-from-sliced-chebyshev.md)
- [Infinite ResNets are Gaussian Mean ODEs](https://refivu.com/en/papers/0621dc56-f1ec-450b-a73b-99b02aadc462-infinite-resnets-are-gaussian-mean-odes.md)
- [Robustness Starts with the Objective: Designing and Certifying Robust LLM-Generated Heuristics](https://refivu.com/en/papers/c5ef476a-8e13-4a8d-9bf3-f756d8e0931c-robustness-starts-with-the-objective-designing-and.md)
- [CogRSI: Evolving and Auditing Cognitive Reasoning Strategies](https://refivu.com/en/papers/46f7d70e-b92f-4b54-90ab-d6436dede203-cogrsi-evolving-and-auditing-cognitive-reasoning-strategies.md)
- [Temperature, Not Knowledge: What Recursive Self-Training and Its Remedies Do to a Language Model's Confidence](https://refivu.com/en/papers/647a62a0-780f-4069-8540-3b3571002565-temperature-not-knowledge-what-recursive-self-training-and.md)
- [Audit at the Precision You Deploy: Quantization Reshapes a Subliminally Learned Preference](https://refivu.com/en/papers/6f240a8e-b6ab-4701-8476-19bd531d562e-audit-at-the-precision-you-deploy-quantization-reshapes.md)
- [Integer-Exact Microscaling: Running MXFP4 Language Models on INT8 Matrix Units](https://refivu.com/en/papers/cc6caaac-3d30-4b25-b682-a3f14b4cd27b-integer-exact-microscaling-running-mxfp4-language-models-on.md)
- [Where Causal Discovery Breaks on Real Data: Measuring the Assumptions One Property at a Time](https://refivu.com/en/papers/d714537a-ff4c-4155-99f7-03eb8fffe631-where-causal-discovery-breaks-on-real-data-measuring.md)

## Terms in this paper

- [GPT-5.6 Sol](https://refivu.com/en/terms/0152cafc35d2-gpt-5-6-sol)
- [Hit@1](https://refivu.com/en/terms/268b347125ee-hit-1)
- [Llama-3.2-3B-Instruct](https://refivu.com/en/terms/8d50b7805114-llama-3-2-3b-instruct)
- [self-check](https://refivu.com/en/terms/cb947fea9fc4-self-check)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/55f50616-1dd4-415c-b847-5176baf35714-war-craft-refining-web-api-recommendations-through)
