Merge main into the RSS 2025 proceedings branch
Metadata integrity checks / metadata (push) Successful in 7m47s

This commit is contained in:
2026-11-23 02:55:14 +08:00
229 changed files with 95770 additions and 24 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+54
View File
@@ -0,0 +1,54 @@
<HTML><HEAD><TITLE>AAMAS 2025: Proceedings of the 2025 International Conference on Autonomous Agents and Multiagent Systems</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8"><LINK
href="forms/index_files/factemplate.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.3562" name=GENERATOR></HEAD>
<BODY bgcolor="#010101" bgproperties="fixed"><DIV style="TEXT-ALIGN: center" >
<table width="724" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">
<td colspan="2" align="center" valign="top" bgcolor="#FFFFFF"><img src="forms/index_files/aamas25.png" width="750" height="300" alt=""/></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="125" align="center" valign="top" bgcolor="#FFFFFF"><table width="125" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#444444" style="margin-bottom: 2">
<tr>
<td bgcolor="#FFFFFF"><p style="text-indent: 0; margin-left: 6; margin-right: 6; margin-top: 5; margin-bottom: 4" align="left"><A href="forms/index.htm">Main
Page</A></p></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><p style="text-indent: 0; margin-left: 6; margin-right: 6; margin-top: 5; margin-bottom: 4" align="left"><A href="forms/contents.htm">Table
of Contents</A></p></td>
</tr>
</table></td>
<td width="599"><p style="text-indent: 0; margin-left: 12; margin-right: 14; margin-top: 12; margin-bottom: 12" align="left"><font color="#010101" size="4" face="Arial, Helvetica, sans-serif"><strong>Welcome
to the Proceedings of AAMAS-2025</strong></font></p>
<p style="text-indent: 0; margin-left: 12; margin-right: 14; margin-top: 12; margin-bottom: 12;" align="left"><font color="#333333" size="2" face="Times New Roman, Times, serif">These
are the proceedings of the 24th International Conference on Autonomous
Agents and Multiagent Systems (AAMAS-2025). They are published by the
International Foundation for Autonomous Agents and Multiagent Systems
(IFAAMAS).</font></p></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
<td><table width="96%" border="0" cellspacing="2" cellpadding="2">
<tr align="left" valign="top">
<td> <p style="text-indent: 0; margin-left: 12; margin-right: 6; margin-top: 0; margin-bottom: 6;" align="left"><font color="#333333" face="Times New Roman, Times, serif"><font size="2"><strong>ISBN: 979-8-4007-1426-9</strong></font></font></p></td>
<td> <p style="text-indent: 0; margin-left: 12; margin-right: 6; margin-top: 0; margin-bottom: 6;" align="left"><font color="#333333" face="Times New Roman, Times, serif"></font></p></td>
</tr>
<tr>
<td width="42%"><div align="left"><img src="forms/index_files/ifaamas.jpg" width="256" height="104"></div></td>
<td width="58%"><div align="center"><img src="forms/index_files/ACM-In-Cooperation_medium.jpg" width="285" height="86"></div></td>
</tr>
</table>
<p style="text-indent: 0; margin-left: 12; margin-right: 14; margin-top: 12; margin-bottom: 12;" align="left"><font color="#333333" size="2" face="Times New Roman, Times, serif">Copyright
&copy; 2025 by International Foundation for Autonomous Agents and Multiagent
Systems (IFAAMAS). Permission to make digital or hard copies of portions
of this work for personal or classroom use is granted without fee provided
that copies are not made or distributed for profit or commercial advantage
and that copies bear this notice and the full citation on the first page.
Copyright for components of this work owned by others than IFAAMAS must
be honored. Abstracting with credit is permitted. To copy otherwise, to
republish, to post on servers or to redistribute to lists, requires prior
specific permission and/or a fee. </font></p></td>
</tr>
</table>
<p>&nbsp;</p>
</BODY></HTML>
+38
View File
@@ -0,0 +1,38 @@
{
"status": "two_successful_official_metadata_pages_recovered_third403_not_retried",
"receipts": [
{
"file": "index.html",
"url": "https://www.ifaamas.org/Proceedings/aamas2025/",
"bytes": 4107,
"sha256": "850b7825c66d0147ac8a8bbf03a554590e4a9e8f4b5c576e043999bbd43317f4",
"at": "2026-11-09T12:31:49.347577+00:00",
"at_precision": "filesystem_write_time_recovered",
"http_status": 200,
"content_type": "text/html",
"receipt_recovered": true,
"scope": "Collectorasserted200/htmlbeforewrite;request3acceptedprogram403;noheaders/finalredirectURLpersisted;no refetch or rawbytesmutation."
},
{
"file": "contents.html",
"url": "https://www.ifaamas.org/Proceedings/aamas2025/forms/contents.htm",
"bytes": 370650,
"sha256": "732847b51972f34c721a49d8bd963a80a029a48f3ec08022c9a0d5ddc2945549",
"at": "2026-11-09T12:31:52.006642+00:00",
"at_precision": "filesystem_write_time_recovered",
"http_status": 200,
"content_type": "text/html",
"receipt_recovered": true,
"scope": "Collectorasserted200/htmlbeforewrite;request3acceptedprogram403;noheaders/finalredirectURLpersisted;no refetch or rawbytesmutation."
}
],
"failed_url": "https://aamas2025.org/index.php/conference/program/accepted-papers/",
"not_attempted_url": "https://aamas2025.org/index.php/conference/calls/submission-instructions-main-technical-track/",
"original_error": {
"error": "HTTP Error 403: Forbidden",
"type": "HTTPError",
"downloaded": 2
},
"research_fulltext_downloaded": false,
"database_written": false
}
Binary file not shown.
+263
View File
@@ -0,0 +1,263 @@
<?xml version='1.0' encoding='UTF-8'?>
<collection id="1963.earlymt">
<volume id="1" ingest-date="2021-11-14" type="proceedings">
<!-- https://aclanthology.org/1963.earlymt-1/ -->
<meta>
<booktitle>Proceedings of the Annual meeting of the Association for Machine Translation and Computational Linguistics</booktitle>
<address>Denver, Colorado</address>
<month>25-26 August</month>
<year>1963</year>
<pdf hash="2ff28cb1"/>
<venue>earlymt</venue>
</meta>
<paper id="1">
<!-- https://aclanthology.org/1963.earlymt-1.1/ -->
<title>Necessity of introducing some information provided by transformational analysis into <fixed-case>MT</fixed-case> algorithms</title>
<author><first>Irena</first><last>Bellert</last></author>
<abstract>A few examples of ambiguous English constructions and their Polish equivalents are discussed in terms of the correlation between their respective phrase-marker representations and transformational analyses. It is shown by these examples that such an investigation can reveal interesting facts for MT, and therefore should be carried out for any pair of languages for which a given MT program is being constructed. If the phrase-marker of the English construction is set into one-to-one correspondence with the phrasemarker of the Polish equivalent construction, whatever particular transformational analysis of this construction is to be taken into account, then the ambiguous phrasemarker representation can be used as a syntactical model for MT algorithms with good results. If the phrase-marker of the English construction is set into one-to-many correspondence with the phrasemarkers of the Polish equivalents, according to the transformational analyses of this construction, then the ambiguous phrase-structure representation has to be resolved in terms of transformational analysis, for only then is it possible to assign the corresponding phrase structure representation to the Polish equivalents. A tentative scheme of syntactical recognition is provided for the multiply ambiguous adjectival construction in English1 (which proved to belong to the latter case) by means of introducing some information obtained from the transformational analysis of this construction.</abstract>
<bibkey>bellert-1963-necessity</bibkey>
</paper>
<paper id="2">
<!-- https://aclanthology.org/1963.earlymt-1.2/ -->
<title>The use of a random access device for dictionary lookup</title>
<author><first>Robert S.</first><last>Betz</last></author>
<author><first>Walter</first><last>Hoffman</last></author>
<abstract>The purpose of this paper will be to present a scheme to locate for single textual items and idioms in textual order their corresponding dictionary entries stored in an IBM 1301 random access mechanism. Textual items are considered to be 24 characters in length (left justified with following blanks). A dictionary entry consists of a 24 character Russian form, grammar information for the form and a set of translations for that form. Dictionary entries are packed into sequential tracks of the 1301. This paper will cover the method used for dictionary storage. The lookup for a textual item I first consists of a search for the first track that the dictionary entry E (if one exists) for I could be stored in. Once a track has been determined its contents are searched in core by a bisection convergence technique to find E. If E cannot be found, a “no entry” indication is made. If E is found a further search is made of the dictionary to find the longest sequence of text, starting with the first item I, that has a dictionary entry. The last such entry found is picked up. Included in the presentation will be examples of the dictionary lookup output for actual text.</abstract>
<bibkey>betz-hoffman-1963-use</bibkey>
</paper>
<paper id="3">
<!-- https://aclanthology.org/1963.earlymt-1.3/ -->
<title>Generative processes for <fixed-case>R</fixed-case>ussian impersonal sentences</title>
<author><first>C. G.</first><last>Borkowski</last></author>
<author><first>L. R.</first><last>Micklesen</last></author>
<abstract>Impersonal sentences of Russian are those traditionally construed to consist of predicates only. Ever since the first Russian grammar was compiled, they have continued to pose a problem for grammarians. This paper is intended to be a review and evaluation of all types of the so-called impersonal sentences in the Russian language. The investigation of these sentences has been conducted in terms of their relationships to basic (kernel) sentences. Our paper attempts to define the origin for such impersonal sentences, i.e., how such sentences might be derived within the framework of a generative grammar from a set of rules possessing maximal simplicity and maximal generative power. The long-range aim of this investigation involves the most efficient manipulation of such sentences in a recognition device for Russian-English MT.</abstract>
<bibkey>borkowski-micklesen-1963-generative</bibkey>
</paper>
<paper id="4">
<!-- https://aclanthology.org/1963.earlymt-1.4/ -->
<title>Concerning the role of sub-grammars in machine translation</title>
<author><first>Joyce M.</first><last>Brady</last></author>
<author><first>William B.</first><last>Estes</last></author>
<abstract>The comprehensive grammars being developed at the Linguistics Research Center of the University of Texas will be too large for easy access and manipulation in either experimental programs or practical translation. It is necessary, therefore, to devise some reliable method for selecting subsets of the grammar rules which will be reasonably adequate for a given purpose. Since the majority of the rules are dictionary rules, this problem is closely related both to the problem of constructing microglossaries and to the subsequent problem of choosing a particular microglossary suitable to a given text. Our current approach to this problem entails the construction of key word lists in the first stage of analysis which guide the computer in its choice of a previously constructed microglossary. Work to date indicates adaptations of this technique may not only contribute to the solution of storage and access problems but also facilitate analysis and simplify problems of semantic resolution.</abstract>
<bibkey>brady-estes-1963-concerning</bibkey>
</paper>
<paper id="5">
<!-- https://aclanthology.org/1963.earlymt-1.5/ -->
<title>Word-meaning and sentence-meaning</title>
<author><first>Elinor K.</first><last>Charney</last></author>
<abstract>A theory of semantics is presented which (1) defines the meanings of the most frequently occurring semantic morphemes (‘all’, ‘unless’, ‘only’, ‘if’, ‘not’, etc.), (2) explains their role, as semantically interdependent structural-constants, in giving rise to sentence-meanings, (3) suggests a possible approach to a sentenceby-sentence recognition program, and (4) offers a feasible method of coordinating among different language systems synonymous sentences whose grammatical features and structural-constants do not bear a one-to-one correspondence to one another. The theory applies only to morphemes that function as structural-constants and their interlocking relationships, denotative terms being treated as variables whose ranges alone have structural significance in sentencemeaning. The basic views underlying the theory are: In any given sentence, it is the particular configuration of structural-constants in combination with specific grammatical features which produces the sentencemeaning; the defined meaning of each individual structural-constant remains constant. The word-meanings of this type of morpheme, thus, must be carefully distinguished from the sentence-meanings that configuration of these morphemes produce. Sentence-synonymy is not based upon word-synonymy alone. Contrary to the popular view that the meanings of all of the individual words must be known before the sentencemeaning can be known, it is shown that one must comprehend the total configuration of structural-constants and syntactical features in a sentence in order to comprehend the correct sentence-meaning and that this understanding of the sentence as a whole must precede the determination of the correct semantic interpretation of these critical morphemes. In fact, the structural features that produce the sentence-meanings may restrict the possible meanings of even the denotative terms since a structural feature may demand, for example, a verbal rather than a noun phrase as an indispensable feature of the configuration. Two or more synonymous sentences whose denotative terms are everywhere the same but whose structural configurations are not isomorphic express the same fundamental sentence-meaning. The fundamental sentence-meanings can be explicitly formulated, and serve as the mapping functions to co-ordinate morphemically-unlike synonymous sentences within a language system or from one system to another. The research goal of the author is to establish empirically these translation rules that state formally the structural characteristics of the sentence configurations whose sentence-meanings, as wholes, are related as synonymous.</abstract>
<bibkey>charney-1963-word</bibkey>
</paper>
<paper id="6">
<!-- https://aclanthology.org/1963.earlymt-1.6/ -->
<title>Translating ordinary language into symbolic logic</title>
<author><first>Jared L.</first><last>Darlington</last></author>
<abstract>The paper describes a computer program, written in COMIT, for translating ordinary English into the notation of propositional logic and first-order functional logic. The program is designed to provide an ordinary language input to a COMIT program for the David-Putnam proof-procedure algorithm. The entire set of operations which are performed on an input sentence or argument are divided into three stages. In Stage I, an input sentence ‘S’, such as “The composer who wrote ‘Alcina’ wrote some operas in English,” is rewritten in a quasi-logical notation, “The X/A such that X/A is a composer and X/A wrote Alcina wrote some X/B such that X/B is an opera and X/B is in English.” The quasi-logical notation serves as an intermediate language between logic and ordinary English. In Stage II, S is translated into the logical notation of propositional functions and quantifiers, or of propositional logic, whichever is appropriate. In Stage III, S is run through the proof-procedure program and evaluated. (The sample sentence quoted is of course ‘invalid’, i.e. nontautological.) The COMIT program for Stage III is complete, that for Stage II is almost complete, and that for Stage I is incomplete. The paper describes the work done to date on the programs for Stages I and II.</abstract>
<bibkey>darlington-1963-translating</bibkey>
</paper>
<paper id="7">
<!-- https://aclanthology.org/1963.earlymt-1.7/ -->
<title>The graphic structure of word-breaking</title>
<author><first>J. L.</first><last>Dolby</last></author>
<author><first>H. L.</first><last>Resnikoff</last></author>
<abstract>In a recent paper1 the authors have shown that it is possible to determine the possible parts of speech of English words from an analysis of the written form. This determination depends upon the ability to determine the number of graphic syllables in the word. It is natural, then, to speculate as to the nature of graphic syllabification and the relation of this phenomenon to the practice of word-breaking in dictionaries and style manuals. It is not at all clear at the start that dictionary wordbreaking is subject to any fixed structure. In fact, certain forms cannot be broken uniquely in isolation since the dictionary provides different forms depending upon whether the word is used as a noun or a verb. However, it is shown in this paper that letter strings can be decomposed into 3 sets of roughly the same size in the following manner: in the first, strings are never broken in English words; in the second, the strings are always broken in English words; and in the third, both situations occur. Rules for breaking vowel strings are obtained by a study of the CVC forms. Breaks involving consonants can be determined by noting whether or not the consonant string occurs in penultimate position with the final c. The final e in compounds also serves to identify the forms that are generally split off from the rest of the word. A thorough analysis is made of the accuracy of the rules given when applied to the 12,000 words of the Government Printing Office Style Manual Supplement on word-breaking. Comparisons are also drawn between this source and several American dictionaries on the basis of a random sample of 500 words.</abstract>
<bibkey>dolby-resnikoff-1963-graphic</bibkey>
</paper>
<paper id="8">
<!-- https://aclanthology.org/1963.earlymt-1.8/ -->
<title>Writing of <fixed-case>C</fixed-case>hinese recognition grammar for machine translation</title>
<author><first>Ching-yi</first><last>Dougherty</last></author>
<abstract>Our approach to this problem is based on the stratificational grammar outlined and the procedures proposed by Dr. Sydney Lamb. How the theory and the procedures can be applied to written Chinese is briefly discussed. For the time being our research is limited to the particular kind of written Chinese found in chemical and biochemical journals. First the Chinese lexes are classified by detailed syntactical analysis, then binary grammar rules are constructed for joining two primary or constitute classes. How a more and more refined classification can eliminate one by one the ambiguity resulting from all possible constructions arising from juxtaposition of two distributional classes is discussed in detail.</abstract>
<bibkey>dougherty-1963-writing</bibkey>
</paper>
<paper id="9">
<!-- https://aclanthology.org/1963.earlymt-1.9/ -->
<title>The behavior of <fixed-case>E</fixed-case>nglish articles</title>
<author><first>H. P.</first><last>Edmundson</last></author>
<abstract>Machine translation has often been conceived as consisting of three steps: analysis of source-language sentence, transformation of analyzed pieces, and synthesis of target-language sentence. This paper is concerned with one aspect of the last step, namely, the rules of behavior of English articles. Since the classical definitions of definite and indefinite articles are operationally imprecise, proper mechanistic rules must be formulated in order to permit the automatic insertion or non-insertion of English articles. The rules discussed are of syntactic origin; however, note is also taken of their semantic aspects. This paper describes the methods used to derive these rules and offers ideas for further research.</abstract>
<bibkey>edmundson-1963-behavior</bibkey>
</paper>
<paper id="10">
<!-- https://aclanthology.org/1963.earlymt-1.10/ -->
<title>On representing syntactic structure</title>
<author><first>E. R.</first><last>Gammon</last></author>
<abstract>The idea of sentence depth of Yngve (A Model and an Hypothesis for Language Structure, Proc. Am. Phil. Soc., Vol. 104, No. 5, Oct. 1960) is extended to the notion of “distance” between constituents of a construction. The distance between constituents is defined as a weighted sum of the number of IC cuts separating them. Yngve’s depth is then a maximum distance from a sentence to any of its words. Various systems of weighting cuts are investigated. For example, in endocentric structures we may require that the distance from an attribute to the structure exceeds the distance from the head to the structure, and in exocentric structures that the distances from each constituent to the structure are equal. Representations of constructions are considered which preserve the distance between constituents. It is shown that it is impossible to represent some sentences in Euclidean space with exact distances, but a representation may be found if only relative order is preserved. If more general spaces are used then exact distances may be represented. It follows that for a wide class of sentence types, there is a weighting, and a space, in which the distance preserving representations are identical with the diagrams of traditional grammar.</abstract>
<bibkey>gammon-1963-representing</bibkey>
</paper>
<paper id="11">
<!-- https://aclanthology.org/1963.earlymt-1.11/ -->
<title>La traduction automatique et l’enseignement du russe</title>
<author><first>Yves</first><last>Gentilhomme</last></author>
<abstract>Les recherches effectuées depuis quelques années en vue de la Traduction Automatique ont conduit à des méthodes de travail et à des résultats intéressant la pédagogie des langues. Une expérience d’enseignement du russe a l’usage des scientifiques fondée sur ces données a été poursuivie pendant deux ans à Paris (Centre National de la Recherche Scientifique et Faculté des Sciences), et a abouti à la publication d’un manuel. Le present compte-rendu a pour objet de préciser les principes généraux utilisés, la réaction des étudiants et le rendement pédagogique obtenu. 1. Graphes morphologiques: Les mots d’une même famille. Notion de base. La double ramification. Les graphes abstraits. Les néologismes scientifiques. 2. Graphes syntaxiques: La double structure d’une phrase. Multiplicité des modèles. Point de vue psychologique. Notion de fonction. Continuité et discontinuité. 3. Les séparateurs: La segmentation d’une phrase. Le vocabulaire prioritaire. 4. Théorie de la valence: macro et microcontexte. Qu’est-ce-que “connaître un mot”? 5. Point de vue de l’étudiant; point de vue du traducteur humain; et point de vue de l’Enseignant.</abstract>
<bibkey>gentilhomme-1963-la</bibkey>
</paper>
<paper id="12">
<!-- https://aclanthology.org/1963.earlymt-1.12/ -->
<title>Word and context association by means of linear networks</title>
<author><first>Vincent E.</first><last>Giuliano</last></author>
<abstract>This paper is concerned with the use of electrical networks for the automatic recognition of statistical associations among words and contexts present in written text. A general mathematical theory is proposed for association by means of linear transformations, and it is shown that this theory can be realized through use of passive linear electrical networks. Several smallscale experimental associative networks have been built, and are briefly described in the paper; one such device will be demonstrated in the course of the oral presentation of the paper. Some of the devices generate measures of association among index terms used to characterize a document collection, and between the index terms and the documents themselves. Another uses syntactic proximity within sentences as a criterion for the generation of word association measures. Examples are given of associations produced by these network devices. It is conjectured that the networkproduced association measures reflect two distinct types of linguistic association—“synonymy” association which reflects similarity of meaning, and “contiguity” association which reflects real-world relationships among designata.</abstract>
<bibkey>giuliano-1963-word</bibkey>
</paper>
<paper id="13">
<!-- https://aclanthology.org/1963.earlymt-1.13/ -->
<title>A study of the combinatorial properties of <fixed-case>R</fixed-case>ussian nouns</title>
<author><first>Kenneth E.</first><last>Harper</last></author>
<abstract>A statistical study was made of the extent to which Russian nouns enter into certain kinds of syntactic combination. The basis of the study was a corpus of 180,000 running words of Russian physics text prepared for analysis by the Automatic Language Data Processing group at The Rand Corporation; for each sentence of text the syntactic dependency of each word had been previously coded. A data retrieval program was applied, showing for each noun in text the number of occurrences (a) with at least one genitive noun dependent, (b) with at least one adjective dependent, and (c) with either type of dependent. A listing of all nouns in text (64,026 occurrences of 2,993 nouns) was prepared, ordered by frequency, and showing counts for a, b, and c above. Separate listings were prepared, showing for each noun that occurred 50 times or more the probability P that it would be modified in each of these three ways; these listings were ordered on P. The data suggests, among others, the following conclusions: there is statistical significance in the variability with which nouns enter into the given combinations; the partial interchangeability of adjective and genitive noun modification is supported; a general correspondence exists between combinatorial groupings of nouns and morphological or semantic groupings (concrete nouns have low P for genitive complementation, abstract nouns have high P, etc); the use of words in a given field of discourse can be determined empirically (e.g., the use of deverbative nouns either to indicate a process or the result of a process). It is suggested that the distributional approach is a useful supplement to traditional syntactic and semantic classification schemes, and that it is of direct utility in automatic parsing programs.</abstract>
<bibkey>harper-1963-study</bibkey>
</paper>
<paper id="14">
<!-- https://aclanthology.org/1963.earlymt-1.14/ -->
<title>Connectability calculations, syntactic functions, and <fixed-case>R</fixed-case>ussian syntax</title>
<author><first>David G.</first><last>Hays</last></author>
<abstract>A program for sentence-structure determination can be divided into routines for analysis of word order and for testing the grammatical connectability of pairs of sentence members. The present paper describes a connectability-test routine that uses the technique called code matching. This technique requires elaborate descriptions of individual items, say the words or morphemes listed in a dictionary, but it avoids the use of large tables or complicated programs for testing connectability. Development of the technique also leads to a certain clarification of the linguistic concepts of function, exocentrism, and homography. In the present paper, a format for the description of Russian items is offered and a program for testing the connectability of pairs of Russian items is sketched. This system recognizes nine dominative functions: subjective; first, second, and third complementary; first, second, and third auxiliary; modifying; and predicative. The nature of a program for testing connectability with respect to coordinative functions (coordination, apposition, etc.) is suggested.</abstract>
<bibkey>hays-1963-connectability</bibkey>
</paper>
<paper id="15">
<!-- https://aclanthology.org/1963.earlymt-1.15/ -->
<title>Punctuation and automatic syntactic analysis</title>
<author><first>Lydia</first><last>Hirschberg</last></author>
<abstract>In this paper we discuss how algorithms for automatic analysis can take advantage of information carried by the punctuation marks. We neglect stylistic aspects of punctuation because they lack universality of usage and we restrict ourselves to those rules which any punctuation must observe in order to be intelligible. This involves a concept we call “coherence” of punctuation. In order to define “coherence”, we introduce two characteristics, which we prove to be mutually independent, namely “separating power” and “syntactic function”. The separating power is defined by three experimental laws expressing the fact that two punctuation marks of different separating power prevent to a different extent syntactic links from crossing them. These laws are defined independently of any particular grammatical character of the punctuation marks or of the attached grammatical syntagms. On the other hand, whichever grammatical system we choose, we may assimilate the punctuation marks to the ordinary words, to the extent that we can assign to them a known grammatical character and function, well defined in any particular context. They differ however from the other words by their large number of homographs and synonyms i.e. by the fact that almost every punctuation mark can occur with almost every grammatical value in each particular case, and in quite similar contexts. The syntactic functions, in general, and in particular those of the punctuation marks, can be ordered according to an arbitrary scale of decreasing “value” of syntactic links, where the “value” of a link is directly related to the number of syntactic conditions the links must satisfy. The law of coherence, then, shows that in a given context, a particular punctuation mark cannot indistinctly represent all its homographs, so that a certain number of assumptions about its syntactic nature and function can be discarded. This law can be stated as follows: “When moving from a punctuation mark to its immediate (left or right) neighbor in any text, the separating power cannot increase if the value of the syntactic function increases and vice-versa”. In addition we review two related topics, namely the stylistic character of punctuation and the necessity and existence of intrinsic criteria of grammatically, i.e. independent of punctuation. We propose such a criterion, and suggest a formalism related to the parenthesis free notation of logic.</abstract>
<bibkey>hirschberg-1963-punctuation</bibkey>
</paper>
<paper id="16">
<!-- https://aclanthology.org/1963.earlymt-1.16/ -->
<title>Application of decision tables to syntactic analysis</title>
<author><first>Walter</first><last>Hoffman</last></author>
<author><first>Amelia</first><last>Janiotis</last></author>
<author><first>Sidney</first><last>Simon</last></author>
<abstract>Decision tables have recently become an object of investigation as a possible means of improving problem formulation of data processing procedures. The initial emphasis for this new tool came from systems analysts who were primarily concerned with business data processing problems. The purpose of this paper is to investigate the suitability of decision tables as a means of expressing syntactic relations as an alternative to customary flow charting techniques. The history of decision tables will be briefly reviewed and several kinds of decision tables will be defined. As an example, parts of the predicative blocking routine developed at Wayne State University will be presented as formulated with the aid of decision tables. The aim of the predicative blocking routine is to group a predicative form together with its modal and temporal auxiliaries, infinitive complements, and negative particle, if any of these exist. The object of the search is to define such a syntactic block, but it may turn out instead that an infinitive phrase is defined or that a possible predicative form turns out to be an adverb.</abstract>
<bibkey>hoffman-etal-1963-application</bibkey>
</paper>
<paper id="17">
<!-- https://aclanthology.org/1963.earlymt-1.17/ -->
<title>Simultaneous computation of lexical and extralinguistic information measures in dialogue</title>
<author><first>Joseph</first><last>Jaffe</last></author>
<abstract>An approach to the study of information processing in verbal interaction is described. It compares patterns of two indices of dispersion in recorded dialogue. The lexical measure is the mean segmental type—token ratio, based on 25-word segments of the running conversation. It is computed from a key punched transcript of the dialogue without regard to the speaker of the words. The extralinguistic measure is the H statistic, computed from the temporal pattern of the interaction. The latter is prepared from a two-channel tape recording by a special analogue to digital converter (AVTA system) which key punches the state of the vocal transaction 200 times per minute. Probabilities of the four possible states (either A or B speaking, neither speaking, both speaking) are the basis for the computation. All analyses are done on the IBM 7090. The methodology is part of an investigation of information processing in dyadic systems, aimed toward the reclassification of pathological communication.</abstract>
<bibkey>jaffe-1963-simultaneous</bibkey>
</paper>
<paper id="18">
<!-- https://aclanthology.org/1963.earlymt-1.18/ -->
<title>Design of a generalized information system</title>
<author><first>Ronald W.</first><last>Jonas</last></author>
<abstract>While mechanical translation research involves the design of a computer system which simulates language processes, there is the associated problem of collecting the language data which are to be used in translation. Because large quantities of information will be needed, the computer may be useful for data accumulation and verification. A generalized information system should be able to accept the many types of data which a linguist encodes. A suitable means of communication between the linguist and the system has to be established. This may be achieved with a central input, called Linguistic Requests, and a central output, called Information Displays. The requests should be coordinated so that all possible inputs to the system are compatible, and the displays should be composed by the system such that they are clearly understandable. An information system should be interpretive of the linguist’s needs by allowing him to program the data manipulation. The key to such a scheme is that the linguist be permitted to classify his data freely and to retrieve it as he chooses. He should have at his disposal selecting, sorting, and displaying functions with which he can verify data, select data for introduction to a mechanical translation system, and perform other activities necessary in his research. Such an information system has been designed at the Linguistics Research Center of The University of Texas.</abstract>
<bibkey>jonas-1963-design</bibkey>
</paper>
<paper id="19">
<!-- https://aclanthology.org/1963.earlymt-1.19/ -->
<title>Some experiments performed with an automatic paraphraser</title>
<author><first>Sheldon</first><last>Klein</last></author>
<abstract>The automatic paraphrasing system used in the experiments described herein consisted of a phrase structure, grammatically correct nonsense generator coupled with a monitoring system that required the dependency relations of the sentence in production to be in harmony with those of a source text. The output sentences also appeared to be logically consistent with the content of that source. Dependency was treated as a binary relation, transitive except across most verbs and prepositions. Five experiments in paraphrasing were performed with this basic system. The first attempted to paraphrase without the operation of the dependency monitoring system, yielding grammatically correct nonsense. The second experiment included the operation of the monitoring system and yielded logically consistent paraphrases of the source text. The third and fourth experiments demanded that the monitoring system permit the production of only those sentences whose dependency relations were non-existent in the source text. While these latter outputs were seemingly nonsensical, they bore a special logical relationship to the source. The fifth experiment demanded that the monitoring system permit the production of sentences whose dependency relations were the converse of those in the source. This restriction was equivalent to turning the dependency tree of the source text upside down. The output of this experiment consisted only of kernel type sentences which, if read backwards, were logically consistent with the source. The results of these experiments determine some formal properties of dependency and engender some comments about the role of dependency in phrase structure and transformational models of language.</abstract>
<bibkey>klein-1963-experiments</bibkey>
</paper>
<paper id="20">
<!-- https://aclanthology.org/1963.earlymt-1.20/ -->
<title>Interlingual correspondence at the syntactic level</title>
<author><first>Edward S.</first><last>Klima</last></author>
<abstract>The paper will investigate a few major construction types in several related European languages: relative clauses, attributive phrases, and certain instances of coordinate conjunction involving these constructions. In each of the languages independently, the constructions will be described as resulting from syntactic mechanisms further analyzable into chains of partially ordered operations on more basic structures. Pairs of sentences equivalent in two languages will be examined. Sentences will be considered equivalent if they are acceptable translations of one another. The examples used will, in fact, be drawn primarily from standard translations of scholarly and literary prose. Equivalence between whole sentences can be further analyzed, as will be shown, into general equivalence 1) between the chains of operations describing the constructions and 2) between certain elements (e.g., lexical items) in the more basic underlying structures. It will be seen that superficial differences in the ultimate shape of certain translation pairs can be accounted for as the result of minor differences in the particular operations involved or in the basic underlying structure. We shall examine two languages (e.g., French and German) in which attributive phrase formation and relative clause formation on the whole correspond and in which, in a more or less abstract way, the rules of relative clause formation are included as intermediate links in the chain of operations describing attributive phrases. The fact that in particular cases a relative clause in the one language corresponds to an attributive phrase in the other will be found to result from, e.g., differences in the choice of perfect auxiliary in the two languages.</abstract>
<bibkey>klima-1963-interlingual</bibkey>
</paper>
<paper id="21">
<!-- https://aclanthology.org/1963.earlymt-1.21/ -->
<title>Sentence structure diagrams</title>
<author><first>Susumu</first><last>Kuno</last></author>
<abstract>A system for automatically producing a sentence structure diagram for each analysis of a given sentence has been added to the program of the multiple-path syntactic analyzer. A structure code, consisting of a series of structure symbols or phrase markers that identify the successive higher-order structures to which the word in question belongs, is assigned to each word of the sentence. The set of structure codes for the words of a given sentence is equivalent to an explicit tree diagram of the sentence structure, but more compact and easier to lay out on conventional printers. The diagramming system makes some experimental assumptions about the dependencies of certain structures upon higher-level structures. All the major syntactic components of a sentence (i.e., subject, verb, object, complement, period, or question mark) are represented in the current system as occurring on the same level, all being dependent on the topmost level, “sentence”. A floating structure such as a prepositional phrase or adverbial phrase or clause, whose dependency is not determined in the analyzer, is represented as depending upon the nearest preceding structure modifiable by such a floating structure. Different assumptions as to structural dependencies would yield different diagrams without requiring modification on the main flow of the diagramming program. The diagrams thus obtained contribute greatly to the rapid and accurate evaluation of the analysis results, and they are also useful for obtaining basic syntactic patterns of analyzed structures, and for detecting the head of each identified structure.</abstract>
<bibkey>kuno-1963-sentence</bibkey>
</paper>
<paper id="22">
<!-- https://aclanthology.org/1963.earlymt-1.22/ -->
<title>Linguistic structure and machine translation</title>
<author><first>Sydney M.</first><last>Lamb</last></author>
<abstract>If one understands the nature of linguistic structure, one will know what design features an adequate machine translation system must have. To put it the other way around, it is futile to attempt the construction of a machine translation system without a knowledge of what the structure of language is like. This principle means that if someone wants to construct a machine translation system, the most important thing he must do is to understand the structure of language. Any MT system, whether by conscious intention on the part of its creators or not, is based upon some view of the nature of linguistic structure. By making explicit the underlying theory for various MT systems which have been proposed we can determine whether or not they are adequate. Similarly, by observing linguistic phenomena we can determine what properties an adequate theory of language must have, and such determination will show what features an MT system must have in order to be adequate. It can be shown that some of the approaches to MT now being pursued must necessarily fail because their underlying linguistic theories are inadequate to account for various well-known linguistic phenomena.</abstract>
<bibkey>lamb-1963-linguistic</bibkey>
</paper>
<paper id="23">
<!-- https://aclanthology.org/1963.earlymt-1.23/ -->
<title>On redundancy in artificial languages</title>
<author><first>W. P.</first><last>Lehmann</last></author>
<abstract>Artificial languages are one concern of work in computational linguistics, if only as a mnemonic device for interlinguas which will be developed. Even if it does not gain wider use, the structure of an artificial language is of general interest. In contrast to the artificial languages which have been widely proposed, linguistic principles underlying a welldesigned artificial language and its usefulness are wellestablished, particularly through Trubetzkoy’s article, TCLP 8.5-21. which indicates phonological limitations for such a language. Since Trubetzkoy’s specifications yield a total of approximately 11,000 morphemes, if an artificial language incorporated the degree of redundancy found in natural languages it would be severely handicapped by the size of its lexicon. The paper discusses the problem particularly with regard to suprasegmentals, which Trubetzkoy almost entirely ignored.</abstract>
<bibkey>lehmann-1963-redundancy</bibkey>
</paper>
<paper id="24">
<!-- https://aclanthology.org/1963.earlymt-1.24/ -->
<title>A procedure for automatic sentence structure analysis</title>
<author><first>D.</first><last>Lieberman</last></author>
<abstract>The two main considerations in the design of this procedure were the economical recognition and representation of multiple readings of syntactically ambiguous sentences, and general applicability to “all” languages (English, Russian, Chinese). The following features will be discussed: types of structural descriptions, form of linguistic rules, use of linguistic heuristics to achieve economical multiple analyses, application to linguistic research and application to production MT systems. Also, the relation between this procedure and other existing sentence analysis procedures will be discussed.</abstract>
<bibkey>lieberman-1963-procedure</bibkey>
</paper>
<paper id="25">
<!-- https://aclanthology.org/1963.earlymt-1.25/ -->
<title>An algorithm for the translation of <fixed-case>R</fixed-case>ussian inorganic-chemistry terms</title>
<author><first>L. R.</first><last>Micklesen</last></author>
<author><first>P. H.</first><last>Smith</last></author>
<abstract>An algorithm has been devised, and a computer program written, to translate certain recurring types of inorganic-chemistry terms from Russian to English. The terms arc all noun-phrases, and several different types of such phrases have been included in the program. Examples are: AZOTNONATRIEVA4 SOL6 sodium nitrate SOL6 ZAKISI/OKISI JELEZA ferrous/ferric salt ZAKISNA4 OKISNA4 SOL6 JELEZA GIDRAT ZAKISI/OKISI JELEZA ferrous/ferric salt etc., where the stems underlined may be replaced by any of a number of other stems (up to 65 in some positions) in the particular type. Translation of each type encounters problems common to almost all the types: (1) The Russian noun is translated as an English adjective, while the noun of the resulting English phrase is found among the modifiers of the Russian noun. (2) The Russian noun (English adjective) may be a metal with more than one valence state, the state indicated (if at all) by the modifiers. (3) The number of the resulting English noun-phrase is determined by some member of the Russian phrase other than the noun. (4) The phrase elements may occur compounded in the chemical phrase but free in other contexts, and dictionary storage must provide for this. The program permits translation of conjoined phrase elements as well. The paper also includes an investigation into the deeper grammatical implications of this type of chemical nomenclature, and some excursions into the semantic correlations involved.</abstract>
<bibkey>micklesen-smith-1963-algorithm</bibkey>
</paper>
<paper id="26">
<!-- https://aclanthology.org/1963.earlymt-1.26/ -->
<title>The application of table processing concepts to the Sakai translation technique</title>
<author><first>A.</first><last>Opler</last></author>
<author><first>R.</first><last>Silverstone</last></author>
<author><first>Y.</first><last>Saleh</last></author>
<author><first>M.</first><last>Hildebran</last></author>
<author><first>I.</first><last>Slutzky</last></author>
<abstract>In 1961, I. Sakai described a new technique for the mechanical translation of languages. The method utilizes large tables which contain the syntactic rules of the source and target languages. As part of a study of the AN/GSQ-16 Lexical Processing Machine, a modification of the Sakai method was developed. Five of six planned table scanning phases were implemented and tested. Our translation system (1) converts input text to syntactic and semantic codes with a dictionary scan, (2) clears syntactic ambiguities where resolution by adjacent words is effective, (3) resolves residual syntactic ambiguities by determining the longest meaningful semantic unit, (4) reorders word sequence according to the rules of the target language and (5) produces the final target language translation. French to English was the source-target pair selected for the study. An Input Dictionary of 3,000 French stems was prepared and 17,000 entries comprised the Input Product Table (allowable syntactic combinations ). Since Sakai was working with highly dissimilar languages, he found it necessary to use an intermediate language. Because of the structural similarity between French and English, we found an intermediate language was unnecessary. The method proved straightforward to implement using the table lookup logic of the Lexical Processor. The translation was actually performed on an IBM 1401 which we programmed to simulate the concept of the AN/GSQ-16 Lexical Processor. In our implementation magnetic tapes replaced the photoscopic storage disk.</abstract>
<bibkey>opler-etal-1963-application</bibkey>
</paper>
<paper id="27">
<!-- https://aclanthology.org/1963.earlymt-1.27/ -->
<title><fixed-case>S</fixed-case>lavic languages—comparative morphosyntactic research</title>
<author><first>Milos</first><last>Pacak</last></author>
<abstract>An appropriate goal for present-day linguistics is the development of a general theory of relations between languages. One necessary requirement in the development of such a theory is the identification and classification of inflected forms in terms of their morphosyntactic properties in a set of presumably related languages. According to Sapir, “all languages differ from one another, but certain ones differ far more than others”. As for the Slavic languages he might well have said that they are all alike, but some are more alike than others. The similarities stemming from their common origin and from subsequent parallel development enable us to group them into a number of more or less homogeneous types. The experimental comparative research at The Georgetown University was focused on a group of four Slavic languages, namely, Russian, Czech, Polish and Serbocroatian. The first step in the comparative procedure here described is the morphosyntactic analysis of each of the four languages individually. The analysis should be based on the complementary distribution of inflectional morphemes. The properties whose distribution must be determined are: 1) the graphemic shape of the inflectional morphemes, 2) the establishment of distributional classes and subclasses of stem morphemes and (on the basis of 1 and 2), 3) the morphosyntactic function of inflectional morphemes which is determined by the distributional subclass of the stem morpheme. f(x,y)-l, where x is the distributional subclass of the stem morpheme (which is a constant) and y is the given inflectional morpheme (which is a free variable). On the basis of this preliminary analysis the patterns of absolute equivalence, partial equivalence, and absolute difference can be established for each class of inflected forms in each language under study. Once this has been accomplished, the results can be used in order to determine the extent of distributional equivalences among the individual languages. The applicability of this procedure was tested on the class of adjectivals. Within the frame of adjectivals the following morphosyntactic properties were analyzed within each language languages: 1) the category of gender, 2) the category of animateness, 3) the category of case and murder. The product of this comparative analysis is a set of formation rules which embody a system for the identification of the inflected forms. The detailed result will be presented in an additional report.</abstract>
<bibkey>pacak-1963-slavic</bibkey>
</paper>
<paper id="28">
<!-- https://aclanthology.org/1963.earlymt-1.28/ -->
<title>Types of language hierarchy</title>
<author><first>E. D.</first><last>Pendergraft</last></author>
<abstract>Various relations lead to hierarchical systems of linguistic description. This paper considers briefly a typology of descriptive metalanguages based on such relations and sketches possible consequences for computational linguistics. Its scope is accordingly limited to metalanguages having operational interpretations which specify individual linguistic processes and structural interpretations which specify language data of individual languages. Immediate-constituent, context-free metalanguages are used to illustrate hierarchical types.</abstract>
<bibkey>pendergraft-1963-types</bibkey>
</paper>
<paper id="29">
<!-- https://aclanthology.org/1963.earlymt-1.29/ -->
<title>Path economization in exhaustive left-to-right syntactic analysis</title>
<author><first>Warren J.</first><last>Plath</last></author>
<abstract>In exhaustive left-to-right syntactic analysis using the predictive approach, each path of syntactic connection which originates at the beginning of a sentence must be followed until it is clear whether or not it will lead to the production of a well-formed analysis. The original scheme of following each path until it terminates either in an analysis or in a grammatical inconsistency has been considerably improved through the. incorporation of two path-testing techniques. Using the first technique, the program abandons a path as unproductive whenever a situation is detected where the prediction pool contains more predictions of a given type than can possibly be fulfilled by the remaining words in the sentence. Employment of the second technique, which is based on periodic comparison of the current prediction pool with pools formed on earlier productive paths, eliminates repeated analysis of identical right-hand segments which belong to distinct paths. Taken together, the two path-testing procedures frequently enable the program to terminate the processing of a path well before its end has been reached. For most sentences, this means a considerable reduction in the total path length traversed, accompanied by a corresponding increase in the speed of analysis. Comparison of runs performed using both versions of the program indicates that employment of the new techniques reduces the average running time per sentence to less than one-fifth of its former value.</abstract>
<bibkey>plath-1963-path</bibkey>
</paper>
<paper id="30">
<!-- https://aclanthology.org/1963.earlymt-1.30/ -->
<title>A computer representation for semantic information</title>
<author><first>Bertram</first><last>Raphael</last></author>
<abstract>This paper deals with the problem of representing in a useful form, within a digital computer, the information content of statements in natural language. The model proposed consists of words and list-structure associations between words. Statements in simple English are thought of as describing relations between objects in the real world. Sentences are analyzed by matching them against members of a list of formats, each of which determines a unique relation. These relations are stored on description-lists associated with those words which denote objects (or sets of objects). A LISP computer program uses this model in the context of a simple question-answering system. Functions are provided which may grow, search, and modify this model. Formats and functions dealing with set-relations, part-whole and numeric relations, and left-toright spatial relations have been included in the system, which is being expanded to handle other types of relations. All functions which operate on the model report information concerning their actions to the programmer, so that the applicability and limitations of this kind of model may more easily be evaluated.</abstract>
<bibkey>raphael-1963-computer</bibkey>
</paper>
<paper id="31">
<!-- https://aclanthology.org/1963.earlymt-1.31/ -->
<title>Specifications for generative grammars used in language data processing</title>
<author><first>Robert</first><last>Tabory</last></author>
<abstract>It becomes more and more evident that successful pragmatics (i.e. automatic recognition and production procedures for sentences) cannot be performed without previously written generative grammars for the languages involved, using an underlying meta-theoretical framework proposed by the present school of mathematical linguistics. Two aspects of grammar writing are examined: 1. A taxonomy over the non-terminal vocabulary, using a subscripting system for signs and fitting into the more general string taxonomy of phrase structure components. The resulting more complex lexical organization is studied. 2. A command syntax for phrase structure components limiting the full, not necessarily needed generative power of these grammars. The proposed restrictions correspond to a priori linguistic intuition. Applicational order and location of the rules is studied. Finally, the recognitional power and generative capacity of a computer are examined, the machine being structured according to a Newell-Shaw-Simon list system. It is well known that pushdown stores are particular cases of list structures, that context-free grammars are particular cases of phrase structure grammars and that pushdown stores are the generative devices for context-free grammars.</abstract>
<bibkey>tabory-1963-specifications</bibkey>
</paper>
<paper id="32">
<!-- https://aclanthology.org/1963.earlymt-1.32/ -->
<title>Collecting linguistic data for the grammar of a language</title>
<author><first>Wayne</first><last>Tosh</last></author>
<abstract>Establishing the grammatical description of a language is one of the major tasks facing the technician in machine translation. Another is that of creating the system of programs with which to carry out the translation process. The Linguistics Research Center of The University of Texas recognizes the advantages in maintaining the specialties of linguistic research and computer programming as two separate areas of endeavor. We regard the linguistic task as a problem in convergence. We do not expect ever to have a final description of a language (except theoretically for a given point in the history of that language). We do expect, however, to begin with almost immediate application of the very first grammatical description. We shall make repeated revisions of the grammar as we learn how to make it approximate better the language text fed into the computer. The grammatical description of any one language is based primarily on specific text evidence. We are not attempting to describe “the language”. We are, however, attempting to make descriptive decisions sufficiently general that new text evidence does not require extensive revision of earlier descriptions. Corpora selected for description are chosen so as to have similar texts within the same scientific discipline for the several languages. Tree diagrams are drawn for each sentence in detail. The diagrams are inspected for consistency before corresponding phrase-structure rules are compiled in the computer. The grammar is then verified in the computer system and revised as necessary.</abstract>
<bibkey>tosh-1963-collecting</bibkey>
</paper>
<paper id="33">
<!-- https://aclanthology.org/1963.earlymt-1.33/ -->
<title>Derivational suffixes in <fixed-case>R</fixed-case>ussian general vocabulary and in chemical nomenclature</title>
<author><first>John H.</first><last>Wahlgren</last></author>
<abstract>A grammar based upon a conventional morphemic analysis of Russian will have a rather large inventory of derivational suffixes. A relatively small number of these recur with sufficient generality to acquire lexemic status (i.e., to be what is usually termed “productive”). Names of chemical substances in Russian may likewise be analyzed as combinations of roots or stems with derivational affixes, in particular, suffixes. The number of productive suffixes in the chemical nomenclature is considerably larger than in the general vocabulary. These suffixes derive from adoption into Russian of an international system of chemical nomenclature. A grammar of this system is basically independent of any grammar of Russian. It must, however, be consistently incorporated into the grammar and dictionary which are to serve in a machine translation system for texts in the source language containing chemical names. Grammatical analysis of chemical suffixes and connected study of general Russian derivational suffixes has raised certain practical problems and theoretical questions concerning the nature of derivation. On the practical side, where a complex and highly productive system is involved, effective means of detecting and dealing with homography have required development. Theoretical consideration has been given to the question of grammaticality in chemical names and to problems of sememic analysis and classification of root and stem lexemes into tactic classes on the basis of cooccurrence with derivational suffixes.</abstract>
<bibkey>wahlgren-1963-derivational</bibkey>
</paper>
<paper id="34">
<!-- https://aclanthology.org/1963.earlymt-1.34/ -->
<title>On the order of clauses</title>
<author><first>Victor H.</first><last>Yngve</last></author>
<abstract>We used to think that the output of a translation machine would be stylistically inelegant, but this would be tolerable if only the message got across. We now find that getting the message across accurately is difficult, but we may be able to have stylistic elegance in the output since much of style reflects depth phenomena and thus is systematic. As an example, the order of the clauses in many twoclause sentences can be reversed without a change of meaning, but the same is not normally true of sentences with more than two clauses. The meaning usually changes when the clause order is changed. Equivalently, there appear to be severe restrictions on clause order for any given meaning. These restrictions appear to follow from depth considerations. The idea is being investigated that there is a normal depth-related clause order and any deviations from this order must be signalled by special syntactic or semantic devices. The nature of these devices is being explored. When translating multi-clause sentences, there may be trouble due to the fact that the clause types of the two languages are not exactly parallel. Therefore the list of allowed and preferred clause orders in the two languages will not be equivalent and the special syntactic and semantic devices available to signal deviations from the normal order will be different. Thus one would predict that multi-clause sentences in language A often have to be split into two or more sentences when translated into language B, while at the same time multi-clause sentences in language B will often have to be broken into two or more sentences when translating into language A.</abstract>
<bibkey>yngve-1963-order</bibkey>
</paper>
</volume>
</collection>
+273
View File
@@ -0,0 +1,273 @@
<?xml version='1.0' encoding='UTF-8'?>
<collection id="T78">
<volume id="1" type="proceedings">
<!-- https://aclanthology.org/T78-1/ -->
<meta>
<booktitle>Theoretical Issues in Natural Language <fixed-case>P</fixed-case>rocessing-2</booktitle>
<editor id="david-l-waltz"><first>David L.</first><last>Waltz</last></editor>
<venue>tinlap</venue>
<year>1978</year>
</meta>
<frontmatter>
<!-- https://aclanthology.org/T78-1000/ -->
<pdf hash="fb6164ad"/>
<bibkey>tinlap-1978-theoretical</bibkey>
</frontmatter>
<paper id="1">
<!-- https://aclanthology.org/T78-1001/ -->
<title>Testing The Psychological Reality of a Representational Model</title>
<author><first>Dedre</first><last>Gentner</last></author>
<pdf hash="f723a956"/>
<bibkey>gentner-1978-testing-psychological</bibkey>
</paper>
<paper id="2">
<!-- https://aclanthology.org/T78-1002/ -->
<title>What Makes Something “Ad Hoc”</title>
<author id="roger-c-schank"><first>Roger C.</first><last>Schank</last></author>
<pdf hash="636853f9"/>
<bibkey>schank-1978-makes-something</bibkey>
</paper>
<paper id="3">
<!-- https://aclanthology.org/T78-1003/ -->
<title>The Relation of Grammar to Cognition–a Synopsis</title>
<author><first>Leonard</first><last>Talmy</last></author>
<pdf hash="101c67dc"/>
<bibkey>talmy-1978-relation-grammar</bibkey>
</paper>
<paper id="4">
<!-- https://aclanthology.org/T78-1004/ -->
<title>On primitives, prototypes, and other semantic anomalies</title>
<author><first>Terry</first><last>Winograd</last></author>
<pdf hash="f8e47023"/>
<bibkey>winograd-1978-primitives-prototypes</bibkey>
</paper>
<paper id="5">
<!-- https://aclanthology.org/T78-1005/ -->
<title>Taxonomic Lattice Structures for Situation Recognition</title>
<author id="william-a-woods"><first>William A.</first><last>Woods</last></author>
<pdf hash="92957ddf"/>
<bibkey>woods-1978-taxonomic-lattice</bibkey>
</paper>
<paper id="6">
<!-- https://aclanthology.org/T78-1006/ -->
<title>Description Formation and Discourse Model Synthesis</title>
<author id="bonnie-webber"><first>Bonnie Lynn</first><last>Webber</last></author>
<pdf hash="ffded1d2"/>
<bibkey>webber-1978-description-formation</bibkey>
</paper>
<paper id="7">
<!-- https://aclanthology.org/T78-1007/ -->
<title>The Processing of Referring Expressions within a Semantic Network</title>
<author><first>John R.</first><last>Anderson</last></author>
<pdf hash="8bcc083a"/>
<bibkey>anderson-1978-processing-referring</bibkey>
</paper>
<paper id="8">
<!-- https://aclanthology.org/T78-1008/ -->
<title>Reference Diaries</title>
<author><first>Herbert H.</first><last>Clark</last></author>
<author><first>Catherine</first><last>Marshall</last></author>
<pdf hash="d06b7ea2"/>
<bibkey>clark-marshall-1978-reference-diaries</bibkey>
</paper>
<paper id="9">
<!-- https://aclanthology.org/T78-1009/ -->
<title>Subsequent Reference: Syntactic and Rhetorical Constraints</title>
<author id="david-d-mcdonald"><first>David D.</first><last>McDonald</last></author>
<pdf hash="2d424559"/>
<bibkey>mcdonald-1978-subsequent-reference</bibkey>
</paper>
<paper id="10">
<!-- https://aclanthology.org/T78-1010/ -->
<title>Some Psycholinguistic Constraints on the Construction and Interpretation of Definite Descriptions</title>
<author><first>Andrew</first><last>Ortony</last></author>
<pdf hash="69807727"/>
<bibkey>ortony-1978-psycholinguistic-constraints</bibkey>
</paper>
<paper id="11">
<!-- https://aclanthology.org/T78-1011/ -->
<title>Bound Variables and Other Anaphors</title>
<author id="barbara-h-partee"><first>Barbara H.</first><last>Partee</last></author>
<pdf hash="e8e6a510"/>
<bibkey>partee-1978-bound-variables</bibkey>
</paper>
<paper id="12">
<!-- https://aclanthology.org/T78-1012/ -->
<title>The Use of Focus as a Tool for Disambiguation of Definite Noun Phrases</title>
<author id="candace-l-sidner"><first>Candace L.</first><last>Sidner</last></author>
<pdf hash="7b96d2b7"/>
<bibkey>sidner-1978-use-focus</bibkey>
</paper>
<paper id="13">
<!-- https://aclanthology.org/T78-1013/ -->
<title>Focusing in Dialog</title>
<author id="barbara-j-grosz"><first>Barbara J.</first><last>Grosz</last></author>
<pdf hash="8c8d4c2e"/>
<bibkey>grosz-1978-focusing-dialog</bibkey>
</paper>
<paper id="14">
<!-- https://aclanthology.org/T78-1014/ -->
<title>Topic Levels</title>
<author><first>Joseph E.</first><last>Grimes</last></author>
<pdf hash="f485b2ba"/>
<bibkey>grimes-1978-topic-levels</bibkey>
</paper>
<paper id="15">
<!-- https://aclanthology.org/T78-1015/ -->
<title>Toward a Rational Model of Discourse Comprehension</title>
<author><first>Jerry L.</first><last>Morgan</last></author>
<pdf hash="5e12a597"/>
<bibkey>morgan-1978-toward-rational</bibkey>
</paper>
<paper id="16">
<!-- https://aclanthology.org/T78-1016/ -->
<title>Assent and Compliance in Children’s Language Comprehension</title>
<author><first>David R.</first><last>Olson</last></author>
<pdf hash="708bc4a0"/>
<bibkey>olson-1978-assent-compliance</bibkey>
</paper>
<paper id="17">
<!-- https://aclanthology.org/T78-1017/ -->
<title>Speech Acts as a Basis for Understanding Dialogue Coherence</title>
<author id="c-raymond-perrault"><first>C. Raymond</first><last>Perrault</last></author>
<author id="james-allen"><first>James F.</first><last>Allen</last></author>
<pdf hash="d111402b"/>
<bibkey>perrault-allen-1978-speech</bibkey>
</paper>
<paper id="18">
<!-- https://aclanthology.org/T78-1018/ -->
<title>A Framework for Comparing Language Experiences (with particular emphasis on: The Effect of Audience on Discourse Models)</title>
<author><first>Andee</first><last>Rubin</last></author>
<pdf hash="5d9a6150"/>
<bibkey>rubin-1978-framework-comparing</bibkey>
</paper>
<paper id="19">
<!-- https://aclanthology.org/T78-1019/ -->
<title>Intentlonallty and Human Conversations</title>
<author id="jaime-g-carbonell"><first>Jaime G.</first><last>Carbonell Jr</last></author>
<pdf hash="c50fc619"/>
<bibkey>carbonell-jr-1978-intentlonallty-human</bibkey>
</paper>
<paper id="20">
<!-- https://aclanthology.org/T78-1020/ -->
<title>On the Interdependence of Language and Perception</title>
<author id="david-l-waltz"><first>David L.</first><last>Waltz</last></author>
<pdf hash="3c708191"/>
<bibkey>waltz-1978-interdependence-language</bibkey>
</paper>
<paper id="21">
<!-- https://aclanthology.org/T78-1021/ -->
<title>The Problem of Naming Shapes: Vision-Language Interface</title>
<author id="ruzena-bajcsy"><first>R.</first><last>Bajcsy</last></author>
<author id="aravind-joshi"><first>A. K.</first><last>Joshi</last></author>
<pdf hash="50331b4e"/>
<bibkey>bajcsy-joshi-1978-problem-naming</bibkey>
</paper>
<paper id="22">
<!-- https://aclanthology.org/T78-1022/ -->
<title>An Argument about the Composition of Conceptual Structure</title>
<author><first>Ray</first><last>Jackendoff</last></author>
<pdf hash="57d001f8"/>
<bibkey>jackendoff-1978-argument-composition</bibkey>
</paper>
<paper id="23">
<!-- https://aclanthology.org/T78-1023/ -->
<title>On the Ontological Status of Visual Mental Images</title>
<author><first>Stephen Michael</first><last>Kosslyn</last></author>
<pdf hash="fd06e265"/>
<bibkey>kosslyn-1978-ontological-status</bibkey>
</paper>
<paper id="24">
<!-- https://aclanthology.org/T78-1024/ -->
<title>What has language to do with perception? Some speculations on the <i>Lingua Mentis</i></title>
<author><first>Zenon W.</first><last>Pylyshyn</last></author>
<pdf hash="a2f3a044"/>
<bibkey>pylyshyn-1978-language-perception</bibkey>
</paper>
<paper id="25">
<!-- https://aclanthology.org/T78-1025/ -->
<title>Semantic Primitives in Language and Vision</title>
<author id="yorick-wilks"><first>Yorick</first><last>Wilks</last></author>
<pdf hash="b4e13896"/>
<bibkey>wilks-1978-semantic-primitives</bibkey>
</paper>
<paper id="26">
<!-- https://aclanthology.org/T78-1026/ -->
<title>A Note on Partial Match of Descriptions. Can One Simultaneously Question (Retrieve) and Inform (Update)?</title>
<author id="aravind-joshi"><first>Aravind K.</first><last>Joshi</last></author>
<pdf hash="74969243"/>
<bibkey>joshi-1978-note-partial</bibkey>
</paper>
<paper id="27">
<!-- https://aclanthology.org/T78-1027/ -->
<title>With a Spoon in Hand This Must Be the Eating Frame</title>
<author><first>Eugene</first><last>Charniak</last></author>
<pdf hash="f1be68bb"/>
<bibkey>charniak-1978-spoon-hand</bibkey>
</paper>
<paper id="28">
<!-- https://aclanthology.org/T78-1028/ -->
<title>Fragments of a Theory of Human Plausible Reasoning</title>
<author><first>Allan</first><last>Collins</last></author>
<pdf hash="67b4bca2"/>
<bibkey>collins-1978-fragments-theory</bibkey>
</paper>
<paper id="29">
<!-- https://aclanthology.org/T78-1029/ -->
<title>Indirect Responses to Loaded Questions</title>
<author><first>S. Jerrold</first><last>Kaplan</last></author>
<pdf hash="135037f9"/>
<bibkey>kaplan-1978-indirect-responses</bibkey>
</paper>
<paper id="30">
<!-- https://aclanthology.org/T78-1030/ -->
<title>On Reasoning by Default</title>
<author><first>Raymond</first><last>Reiter</last></author>
<pdf hash="0de53d33"/>
<bibkey>reiter-1978-reasoning-default</bibkey>
</paper>
<paper id="31">
<!-- https://aclanthology.org/T78-1031/ -->
<title>Path-Based and Node-Based Inference in Semantic Networks</title>
<author id="stuart-c-shapiro"><first>Stuart C.</first><last>Shapiro</last></author>
<pdf hash="2ddc5535"/>
<bibkey>shapiro-1978-path-based</bibkey>
</paper>
<paper id="32">
<!-- https://aclanthology.org/T78-1032/ -->
<title>The Representation of Derivable Information in Memory: When What Might Have Been Left Unsaid Is Said</title>
<author><first>Rand J.</first><last>Spiro</last></author>
<author><first>Joseph</first><last>Esposito</last></author>
<author><first>Richard J.</first><last>Vondruska</last></author>
<pdf hash="7758fb45"/>
<bibkey>spiro-etal-1978-representation-derivable</bibkey>
</paper>
<paper id="33">
<!-- https://aclanthology.org/T78-1033/ -->
<title>A Heuristic for Paradigms</title>
<author><first>Joseph E.</first><last>Grimes</last></author>
<pdf hash="53b42c16"/>
<bibkey>grimes-1978-heuristic-paradigms</bibkey>
</paper>
<paper id="34">
<!-- https://aclanthology.org/T78-1034/ -->
<title>A Computational Account of Some Constraints on Language</title>
<author id="mitch-marcus"><first>Mitchell</first><last>Marcus</last></author>
<pdf hash="c9724c43"/>
<bibkey>marcus-1978-computational-account</bibkey>
</paper>
<paper id="35">
<!-- https://aclanthology.org/T78-1035/ -->
<title>Remarks on Processing, Constraints, and the Lexicon</title>
<author id="thomas-wasow"><first>Thomas</first><last>Wasow</last></author>
<pdf hash="8beed275"/>
<bibkey>wasow-1978-remarks-processing</bibkey>
</paper>
<paper id="36">
<!-- https://aclanthology.org/T78-1036/ -->
<title>List of questions suggested for consideration in each session</title>
<pdf hash="1950b908"/>
<bibkey>nn-1978-list-questions</bibkey>
</paper>
</volume>
</collection>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+706
View File
@@ -0,0 +1,706 @@
{
"status": "reviewed26_presentation_only_title_correspondences_not_work_identity_approval",
"gold": [
{
"doi": "10.1145/3767308.3834907",
"title": "H\n <sup>2</sup>\n AL: Hyperbolic Hierarchy-aware Aggregative Learning for Registration-based Few-shot Medical Image Segmentation",
"authors": [
"Jia Wang",
"Jiaming Cai",
"Zunying Hu",
"Zhanjie Wu",
"Jinyuan Liu",
"Hua Cheng",
"Yun Peng",
"Xin Fan"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-004.json",
"source_position": 246,
"registry_object_sha256": "dd4a627c13ca806e15e59d3ae894c9216d14d33c85bc5ce7362b51fad8c8a692",
"program_id": "mfp0053",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "516fac88f1b7a2821c1e2b97cc41530f32abbe2514b65b5823427ff3ecdc9a23",
"program_context_pointers": [
"/entries/129/papers/19",
"/entries/129/subsessions/1/items/7"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3834936",
"title": "M\n <sup>3</sup>\n TR: Temporal Retrieval Enhanced Multi-Modal Micro-video Popularity Prediction",
"authors": [
"Jiacheng Lu",
"Weijian Wang",
"Mingyuan Xiao",
"Yang Hua",
"Tao Song",
"Bo Peng",
"Cheng Hua",
"Haibing Guan"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-005.json",
"source_position": 25,
"registry_object_sha256": "93340f8b923d7cc0d848941107351fb661d95effa35b1869921e7163da36bae4",
"program_id": "mfp0229",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "6968e6a2d364075020e0b6c95c9076742531681232c40df511a2e8992c6b25f9",
"program_context_pointers": [
"/entries/109/papers/27",
"/entries/109/subsessions/2/items/3"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3834946",
"title": "<i>PAST:</i>\n Prompt-Adaptive Sampling Termination for Efficient Diffusion Model",
"authors": [
"Renye Yan",
"Jikang Cheng",
"You Wu",
"Wei Peng",
"Zongwei Wang",
"Ling Liang",
"Yimao Cai"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-005.json",
"source_position": 35,
"registry_object_sha256": "4210191c2871090711820aef9aff06289694380c9d0194ec9b8b1e5e40fad00d",
"program_id": "mfp0297",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "b47bd7502bf3a8e9e9dc87e3d9552efe928cc455f843d527a4860c430c5e9490",
"program_context_pointers": [
"/entries/61/papers/40",
"/entries/61/subsessions/3/items/4"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3834956",
"title": "<i>SwiftExplorer:</i>\n Training-free diffusion model alignment with Swift Diversity Exploration",
"authors": [
"Renye Yan",
"Jikang Cheng",
"You Wu",
"Baojin Huang",
"Wei Peng",
"Zongwei Wang",
"Ling Liang",
"Yimao Cai"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-006.json",
"source_position": 235,
"registry_object_sha256": "7f2812ca4072437ecaaa585e85139e7cba0e0d721f9a2c0ac4e9897739faed47",
"program_id": "mfp0339",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "f7809f57290e44fe291ffdc07ea956e5484aa491390cd385db75d056f95b840a",
"program_context_pointers": [
"/entries/88/papers/48",
"/entries/88/subsessions/4/items/0"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835035",
"title": "<i>Balancing Efficiency and Efficacy:</i>\n Training-Free Attention-Guided Switching Between Explicit and Latent Thoughts for MLLMs",
"authors": [
"Haoqian Kang",
"Liupeng Li",
"Kuofeng Gao",
"Jinpeng Wang",
"Zhenyu Lu",
"Bin Chen",
"Ke Chen",
"Yaowei Wang"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-004.json",
"source_position": 8,
"registry_object_sha256": "3d76f692754dc159642eeb1706491631267d437a95c4459674361ebf35f416b9",
"program_id": "mfp0798",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "477e42fa3d5c8236d6415ff18ba26d799d659b9e2f3f09c1d80bc0971dbca125",
"program_context_pointers": [
"/entries/88/papers/39",
"/entries/88/subsessions/3/items/3"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835055",
"title": "TM\n <sup>2</sup>\n Q-Det: Boosting Video Object Detection via Text-Guided Spatiotemporal Mamba and Multimodal Query Learning",
"authors": [
"Qiang Qi",
"Wenqi Shang",
"Xiao Wang",
"Shuyuan Lin"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-004.json",
"source_position": 28,
"registry_object_sha256": "7e3c3e6acdad588970c681bdb92969f5134086baa2a5a7b9414871135d5ea137",
"program_id": "mfp0903",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "8549d38e781896079ab04ef6a771a4061a0fe42df2fa5c5c03a037d59cc9f548",
"program_context_pointers": [
"/entries/129/papers/55",
"/entries/129/subsessions/4/items/7"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835101",
"title": "<scp>ConfAvatar:</scp>\n Confidence-Aware Self-Bootstrapping for Monocular 4D Head Avatar Reconstruction",
"authors": [
"Zifan Zheng",
"Yu Luo",
"Yuxin Huang",
"Chuancheng Shi",
"Mohammad Masbaul Alam Polash",
"Zhiyong Wang",
"Kun Hu"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-008.json",
"source_position": 82,
"registry_object_sha256": "b838756bd0b6af036e408936f8f13a6398d83e524ce0282167199eca092bc7d8",
"program_id": "mfp1175",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "cb8dbe67e16e163e5b136ad3401fc57c827905e9704d7c0a84961bc8f12565f4",
"program_context_pointers": [
"/entries/109/papers/86",
"/entries/109/subsessions/7/items/2"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835374",
"title": "<scp>DateGBC:</scp>\n Deep Fuzzy Granular-Ball Clustering via Adaptive Topology Evolution for Unsupervised Image Segmentation",
"authors": [
"Qianpeng Chong",
"Jiakun Wen",
"Guangyi Wei",
"Wenyi Zeng"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-006.json",
"source_position": 59,
"registry_object_sha256": "a7fe694a04449e841be5181888ae35786d0a4938d87eca1fffb0776d4d350e30",
"program_id": "mfp2617",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "b57b7026c750aeebb47598860b82980215c9e4e4935f6e8611a31b2fe64f73b9",
"program_context_pointers": [
"/entries/61/papers/80",
"/entries/61/subsessions/6/items/8"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835424",
"title": "<i>RTCBench</i>\n : A Scalable Benchmarking Framework for Multi-Party Video Conferencing",
"authors": [
"Evan Ram",
"Tuan Tran",
"Youngwook Son",
"Sangtae Ha"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-005.json",
"source_position": 108,
"registry_object_sha256": "b21198e0eba35d175bc83292be8c87bca2b80a9c8e01f40b640a4e9efc7ecde5",
"program_id": "mfp2909",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "2398ec6539c50b14c7ed4fa773277cc860151ab77b5430b49d935f88e90a487e",
"program_context_pointers": [
"/entries/129/papers/130",
"/entries/129/subsessions/8/items/22"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835452",
"title": "<scp>HeadRouter:</scp>\n Dynamic Head-Weight Routing for Task-Adaptive Audio Token Pruning in Large Audio Language Models",
"authors": [
"He Peize",
"Yaodi Luo",
"Xiaoqian Liu",
"Xuyang Liu",
"Jiahang Deng",
"Yaosong Du",
"Li Bangyu",
"Xiyan Gui",
"Yuxuan Chen",
"Linfeng Zhang"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-004.json",
"source_position": 167,
"registry_object_sha256": "ee31b12972ea5844a50c6c63a6fc3430875c3388a4bf261f8e76cab31112d351",
"program_id": "mfp3048",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "c455de7c27f43d0fb49990ead5fca795334c0b613eafa2b3c6150eb147d9c3fa",
"program_context_pointers": [
"/entries/46/papers/78",
"/entries/46/subsessions/6/items/6"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835460",
"title": "<i>CoAnchor:</i>\n Robust Collaborative Perception under Spatio-Temporal Misalignment via Object-Level Anchors",
"authors": [
"Chi Li",
"Rui Lin",
"Aobo Ji",
"Dongzhu Xu"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-004.json",
"source_position": 175,
"registry_object_sha256": "7c41b0dcb65ad27a1f0961f095889ccc73044776250ec816cf95fc25c30da7f1",
"program_id": "mfp3109",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "5f3d97775d83528d6f41fb2fc481d1848cac7c3f9de1d469039450f9b2ecbff1",
"program_context_pointers": [
"/entries/109/papers/121",
"/entries/109/subsessions/8/items/13"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835544",
"title": "<i>OC-GS:</i>\n Object-Centric Representation and Demand Alignment for Immersive 3D Gaussian Streaming",
"authors": [
"Boyan Li",
"Ruijun Mao",
"Zhicheng Liang",
"Dayou Zhang",
"Fangxin Wang"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-006.json",
"source_position": 129,
"registry_object_sha256": "afc0c7db304251511eef5e223f027dc6314dd70895955ff1a1cb0a461dbfdbe9",
"program_id": "mfp3554",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "00b2ffe1073feede8447bac439ac7842c1ba0841cb6ee38ec1b5e06c3a3dc22e",
"program_context_pointers": [
"/entries/46/papers/153",
"/entries/46/subsessions/9/items/21"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835591",
"title": "DP\n <sup>2</sup>\n -NeRF: Dual-Prior Probabilistic Neural Radiance Fields for Event-Guided Motion Deblurring",
"authors": [
"Jiafeng Huang",
"Wenzhen Jia",
"Shilong Dong",
"Shengjie Zhao"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-007.json",
"source_position": 97,
"registry_object_sha256": "145025e784ec251247f8cd86d0dbee1749666ec71f35566c20e41edd0a2347ce",
"program_id": "mfp3783",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "0b2d267736cfe506de666618820e2934c23395bd25dab63c5a347710445a361c",
"program_context_pointers": [
"/entries/33/papers/158",
"/entries/33/subsessions/10/items/2"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835667",
"title": "MMCoT\n <sup>3</sup>\n : Empowering 3D Scene Understanding with 3D-Text Interleaved Multi-Modal Chain-of-Thought Reasoning",
"authors": [
"Yongqi Shan",
"Yifan Wang",
"Yunzhi Zhuge",
"Lijun Wang",
"Huchuan Lu"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-005.json",
"source_position": 209,
"registry_object_sha256": "8b5ad8d891692e441b6e210304dcd35103835fd35d086c860c7611bf5385a6d9",
"program_id": "mfp4173",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "4924721a2c3328e6bca661654569bca86d3fa69aa5f6c9e3719f827c5f0d7639",
"program_context_pointers": [
"/entries/88/papers/114",
"/entries/88/subsessions/8/items/6"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835763",
"title": "<scp>AudioKV:</scp>\n KV Cache Eviction in Efficient Large Audio Language Models",
"authors": [
"Yuxuan Wang",
"He Peize",
"Xiyan Gui",
"Xiaoqian Liu",
"Junhao He",
"Xuyang Liu",
"Xuming Hu",
"Linfeng Zhang"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-006.json",
"source_position": 192,
"registry_object_sha256": "70054b0a5a2586fd08e75494eee08a26498730554601a5fe2e4efddcaad309de",
"program_id": "mfp4778",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "274b360da553dfc7afdb9072505c2957cec4213e096373e2edbf58236a3fc3a2",
"program_context_pointers": [
"/entries/129/papers/100",
"/entries/129/subsessions/7/items/16"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835895",
"title": "F\n <sup>2</sup>\n -Adapter: A Focus-and-Forget Framework for Generalizable CLIP-based Face Forgery Detection",
"authors": [
"Zan Gao",
"Xin Duan",
"Nian Hu",
"Hao Jia",
"Yibo Zhao",
"Cong Liu"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-001.json",
"source_position": 39,
"registry_object_sha256": "16bdbcc4398df4d9556c14d4d4203127349070669f5d0e1c4bf87756e241b698",
"program_id": "mfp5537",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "b3ef626b66d93ac37a73caf15a4cf9ff92241209c80ee66be5575e6b56f9c899",
"program_context_pointers": [
"/entries/88/papers/184",
"/entries/88/subsessions/11/items/6"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3835959",
"title": "UPR-VAD:\n <i>U</i>\n ncertainty-guided Signal\n <i>P</i>\n urification and\n <i>R</i>\n egularization for Weakly-Supervised\n <i>V</i>\n ideo\n <i>A</i>\n nomaly\n <i>D</i>\n etection",
"authors": [
"Weiliang Huang",
"Weichao Cai",
"Bob Zhang",
"Chao Huang",
"Biao Xue",
"Rongxin Zhang"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-007.json",
"source_position": 21,
"registry_object_sha256": "e96f9e9d67cce31a9235bdc7dc5dba551676f3d36ba72654ae3d5a98ae8d5174",
"program_id": "mfp5823",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "d8469bcb68f8cc19070f3bf9a866c3377ba27fe6445b5bf9337b7599a6881592",
"program_context_pointers": [
"/entries/88/papers/66",
"/entries/88/subsessions/5/items/6"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3836215",
"title": "BLM\n <sub>1</sub>\n : A Boundless Large Model for Cross-Space, Cross-Task, and Cross-Embodiment Learning",
"authors": [
"Wentao Tan",
"Bowen Wang",
"Heng Zhi",
"Chenyv Liu",
"Zhe Li",
"Jian Liu",
"Zengrong Lin",
"Yukun Dai",
"Yipeng Chen",
"Wenjie Yang",
"Enci Xie",
"Hao Xue",
"Baixu Ji",
"Chen Xu",
"Zhibin Wang",
"Tianshi Wang",
"Lei Zhu",
"Heng Tao Shen"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-003.json",
"source_position": 46,
"registry_object_sha256": "b4b51e5d0a4c0a330d01e7638c0bcc73871d750312081bafbd3b8a10529153f2",
"program_id": "mfp7332",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "aa458905209ad562117d72dd33d4d61e000b0d9efaa55dd9672919f40e6cc2fd",
"program_context_pointers": [
"/entries/33/papers/13",
"/entries/33/subsessions/1/items/1",
"/entries/47/papers/0"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3836272",
"title": "SEE: Structure-aware Exploring &amp; Exploiting for Long-horizon GUI Agent Trajectory Synthesis",
"authors": [
"Zhuohang Fan",
"Beichen Zhang",
"Yuanfa Li",
"Changqiao Wu",
"Wei Liu",
"Jian Luan",
"Weigang Zhang"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-002.json",
"source_position": 127,
"registry_object_sha256": "66eebbdef9e2d07fe08f3cb41cd577095f282f1256bdb73fe1e0d4c5d6e55d51",
"program_id": "mfp7635",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "df11d727337f397bab72977bcdce4246b388ef0c8e1198ac47fdc32e68a3aff4",
"program_context_pointers": [
"/entries/88/papers/131",
"/entries/88/subsessions/8/items/23"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3836293",
"title": "Video\n <sup>*</sup>\n Bench: Benchmarking Fine-grained Video Perception with \"Think with Videos\"",
"authors": [
"Ruizhe Chen",
"Zhiting Fan",
"Yang Shi",
"Enxin Song",
"Wenhao Chai",
"Tongkun Guan",
"Songtao Jiang",
"Ruilin Luo",
"Yuanxing Zhang",
"Shuai Bai",
"Sibo Song",
"Zhibo Yang",
"Zuozhu Liu"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-002.json",
"source_position": 148,
"registry_object_sha256": "7332426edb3d15499f175fb98c093b78df21ea95fdd9cfea33da5e925cbec171",
"program_id": "mfp7732",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "f6e4df110fe85d7f6d34eb712cd338443c2e34e924393a4e65e07a0c7b152c9e",
"program_context_pointers": [
"/entries/46/papers/198",
"/entries/46/subsessions/11/items/20"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3836447",
"title": "<i>Insert In Style</i>\n : A Zero-Shot Generative Framework for Harmonious Cross-Domain Object Composition",
"authors": [
"Raghu Vamsi Chittersu",
"Yuvraj Singh Rathore",
"Pranav Adlinge",
"Eswar Sai Pashaula",
"Kunal Swami"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-002.json",
"source_position": 183,
"registry_object_sha256": "92b2c094b96cebbace0150805b65b0a1bc3ca99ed42124bcb8de442a81094e1b",
"program_id": "mfp8648",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "39d3f21f774010980f8b30f2fd800b5243ea7ddc6e091b4d8769de3dee622273",
"program_context_pointers": [
"/entries/107/papers/4",
"/entries/117/papers/30",
"/entries/117/subsessions/2/items/6"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3836600",
"title": "<scp>EEGaze</scp>\n : Multimodal Attention Prediction in Visual Search via EEG-Based Saliency Refinement",
"authors": [
"Mansi Sharma",
"Dinar Orazgaliyev",
"Antonio Krüger",
"Philipp Müller"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-003.json",
"source_position": 140,
"registry_object_sha256": "30b99b234aa2b944d6890119b2524d3b3c3c425bde22f20e813b9517b8f8536b",
"program_id": "mfp9815",
"track_literal": "Main Track",
"track": "main",
"abstract_sha256": "47dcb456aee600663d0df59429c1745b335dbae9bdef2dd1063265429fff49fb",
"program_context_pointers": [
"/entries/46/papers/219",
"/entries/46/subsessions/12/items/17"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3838656",
"title": "<scp>MedMKG:</scp>\n Benchmarking Medical Knowledge Exploitation with Multimodal Knowledge Graph",
"authors": [
"Xiaochen Wang",
"Yuan Zhong",
"Lingwei Zhang",
"Lisong Dai",
"Ting Wang",
"Fenglong Ma"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-003.json",
"source_position": 225,
"registry_object_sha256": "b910b66541ca65127646d35d0cd5737a56ae2e0f311a79526005dec75fca739f",
"program_id": "mds177",
"track_literal": "Datasets",
"track": "datasets",
"abstract_sha256": "5bee3b5e9ff60690509d1f34953f3dcc185c50861e112d2c4a3baf5673f6b945",
"program_context_pointers": [
"/entries/46/papers/23",
"/entries/46/subsessions/1/items/11"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3839012",
"title": "<i>EULALens</i>\n : SEE What YOU Agree!",
"authors": [
"Abhijeet Narang",
"Hagar Elbatanouny",
"Vanishri Shekhawat",
"Hasan Al-Nashash",
"Abhinav Dhall",
"Usman Tariq"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-007.json",
"source_position": 238,
"registry_object_sha256": "81dd29dafd6228f51ae2f32e2bb713272a88df78c78347b9170b54f83db00c84",
"program_id": "mde41",
"track_literal": "Demo and Video",
"track": "demo_and_video",
"abstract_sha256": "9acbb264b8019916aad0845aeae4eb5a9c94903ac5bca3cfb612c857306f6d55",
"program_context_pointers": [
"/entries/94/papers/7"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3839024",
"title": "<scp>ThreatVerse:</scp>\n A Closed-Loop World Model Simulator for Autonomous Driving Safety Evaluation",
"authors": [
"Jiangfan Liu",
"Zexuan Cui",
"Tianyuan Zhang",
"Zonglei Jing",
"Yaoyuan Zhang",
"Jiakai Wang",
"Jinyang Guo",
"Yuqing Ma",
"Lu Sheng",
"Aishan Liu",
"Xianglong Liu"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-008.json",
"source_position": 0,
"registry_object_sha256": "d0571f4562b30e4e7fb2e3aa826068ac14a540d1ae70e8cf0b11fd73c67f26ee",
"program_id": "mde15",
"track_literal": "Demo and Video",
"track": "demo_and_video",
"abstract_sha256": "02fc9b31d2b7667ea13f00c74f923a375373042171aaa1ff1f2010ee9697211a",
"program_context_pointers": [
"/entries/49/papers/4"
],
"single_name_positions": []
},
{
"doi": "10.1145/3767308.3839028",
"title": "<scp>FinAlogy:</scp>\n A Visual Analogy Retrieval System for Financial K-Line Analysis",
"authors": [
"Xiaoyan Yu",
"Ziya Zhao",
"Yunshan Ma",
"Yifan Wei",
"Dianbo Sui",
"Tat-Seng Chua"
],
"kind": "unique_program_format_title_fullauthor_agreement_not_identity_approval",
"source_page": "page-008.json",
"source_position": 4,
"registry_object_sha256": "b18c8e2821873a59318f6f09d1f453dd02195ccedad5c8e0ce1da60ac07466fb",
"program_id": "mde02",
"track_literal": "Demo and Video",
"track": "demo_and_video",
"abstract_sha256": "22f978dd02c05439663c5724f25bb997098fd85f5558d01d836711252d119931",
"program_context_pointers": [
"/entries/49/papers/0"
],
"single_name_positions": []
}
],
"author_disagreement_hold": {
"doi": "10.1145/3767308.3836308",
"program_id": "mfp7801"
},
"scope": "Onlytitlecomparisonchanges;originalregistryandprogramfixturesremainunchanged;sourceABandtrackcomefromtheexplicitprogramID.",
"held_gold": {
"doi": "10.1145/3767308.3836308",
"title": "Dynamic Late Fusion Multiple Kernel\n <i>k</i>\n -means Clustering based on Adaptive Sample Selection and Alignment",
"authors": [
"Zhirong Tian",
"Yi Zhang",
"Weixuan Liang",
"Miaomiao Li",
"Xinwang Liu"
],
"kind": "program_format_author_version_requires_review",
"source_page": "page-001.json",
"source_position": 82,
"registry_object_sha256": "26a3c1715d276b5fbe988596e3115091086158f6ef12600a36e5206785fc9dfb",
"program_id": null,
"track_literal": null,
"track": "proceedings_unclassified",
"abstract_sha256": null,
"program_context_pointers": [],
"single_name_positions": []
}
}
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
{
"receipts": [
{
"url": "https://neurips.cc/static/virtual/data/neurips-2026-orals-posters.json",
"final_url": "https://neurips.cc/static/virtual/data/neurips-2026-orals-posters.json",
"status": 200,
"content_type": "application/json",
"file": "program-json.response",
"bytes": 20447021,
"sha256": "879293a863057fa05370443b3b5ddee12a10eeb37c810abc6c1d53f71f545997",
"started_at": "2026-11-09T17:57:23.825509+00:00",
"finished_at": "2026-11-09T17:57:40.125580+00:00"
}
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+85
View File
@@ -0,0 +1,85 @@
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
from paper_atlas.collectors import aamas, aamas2025
FIXTURE = Path(__file__).parent/'fixtures/aamas2025'
class Aamas2025Tests(unittest.TestCase):
def parse(self, html=None):
return aamas2025.parse_contents(html or (FIXTURE/'contents.html').read_text(),
{'observed_at': '2026-11-09T12:31:50+00:00', 'url': aamas2025.URLS['contents']})
def test_real_toc_preserves_every_title_author_and_affiliation(self):
expected = json.loads((FIXTURE/'expected-authors.json').read_text())
self.assertEqual(hashlib.sha256((FIXTURE/'contents.html').read_bytes()).hexdigest(), expected['source_sha256'])
rows, excluded = self.parse()
self.assertEqual((len(rows), len(excluded)), (476, 3))
by_url = {r['paper_url']: r for r in expected['entries']}
for row in rows:
original = by_url[row['metadata']['paper_url']]
self.assertEqual(row['title'], original['title'])
self.assertEqual(row['authors'], [a['name'] for a in original['authors']])
self.assertEqual(row['metadata']['author_affiliations'], [a['affiliation'] for a in original['authors']])
self.assertIsNone(row['abstract'])
self.assertEqual(row['identifiers'], {})
self.assertEqual(row['status'], 'accepted')
self.assertNotIn('decision_date', row)
self.assertTrue(all(t['namespace'] == 'aamas_proceedings:publication_format' for t in row['tags']))
def test_publication_format_and_track_are_separate(self):
rows, excluded = self.parse()
groups = {k: sum(r['track'] == k for r in rows) for k in {r['track'] for r in rows}}
self.assertEqual(groups, {'proceedings_unspecified': 409, 'blue_sky': 12, 'doctoral': 25, 'demo': 21, 'jaamas': 9})
competition = next(r for r in rows if r['external_id'] == '2025/p3000')
self.assertEqual(competition['year'], 2025)
self.assertEqual(competition['metadata']['publication_format'], 'competition_report')
self.assertEqual(competition['metadata']['section_heading'], 'Demo Track')
self.assertEqual(competition['track'], 'proceedings_unspecified')
self.assertEqual(len({r['external_id'] for r in rows}), 476)
self.assertEqual([r['publisher_page'] for r in excluded], [1, 3, 4])
def test_refuses_changed_edition_inventory_or_author_markup(self):
original = (FIXTURE/'contents.html').read_text()
for html in [original.replace('AAMAS 2025:', 'AAMAS 2026:', 1),
original.replace('../pdfs/p5.pdf', '../pdfs/p14.pdf', 1),
original.replace('Paper Track</font>', 'Workshop Track</font>'),
original.replace('Amir Abolfazli', '', 1),
original.replace('[COMP24]', '[CHANGED]', 1)]:
with self.subTest(change=html[:60]):
with self.assertRaises(ValueError): self.parse(html)
def test_frozen_collection_is_partial_and_never_fetches_pdfs(self):
with tempfile.TemporaryDirectory() as tmp, patch.object(aamas2025, 'fetch', side_effect=AssertionError('No HTTP in frozen mode')):
out = Path(tmp)/'out'
report = aamas.collect(2025, out, snapshots=FIXTURE)
self.assertEqual(report['records'], 476)
self.assertFalse(report['database_written'])
self.assertFalse(report['pdfs_downloaded'])
self.assertEqual(len(report['files']), 5)
for m in report['files']:
self.assertEqual(m['status'], 'partial')
self.assertEqual(m['missing_abstract_count'], m['count'])
self.assertEqual(hashlib.sha256(Path(m['file']).read_bytes()).hexdigest(), m['file_sha256'])
receipt = report['source_receipts'][0]['response_receipt']
self.assertEqual(receipt['at_precision'], 'filesystem_write_time_recovered')
self.assertTrue((out/'aamas-proceedings-2025.json').is_file())
def test_rejects_tampered_or_unsafe_frozen_response(self):
import shutil
for mode in ['tamper', 'path', 'status']:
with self.subTest(mode=mode), tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); source = root/'source'; shutil.copytree(FIXTURE, source)
p = source/'receipts.json'; r = json.loads(p.read_text())
if mode == 'tamper': (source/'contents.html').write_text('bad')
elif mode == 'path': r['receipts'][0]['file'] = '../index.html'
else: r['receipts'][0]['http_status'] = 403
p.write_text(json.dumps(r))
with self.assertRaises(ValueError): aamas.collect(2025, root/'out', snapshots=source)
self.assertFalse((root/'out/aamas-proceedings-2025.json').exists())
+167
View File
@@ -0,0 +1,167 @@
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import sqlite3
import unittest
from unittest.mock import patch
from paper_atlas.collectors import aamas, aamas2026
from paper_atlas.ingestion.records import ingest_file
FIXTURE = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/aamas2026-fixture.json.gz').read_bytes()))
EVIDENCE = {'url': aamas2026.URL, 'observed_at': FIXTURE['receipts']['receipts'][0]['finished_at']}
class Aamas2026Tests(unittest.TestCase):
def parse(self, html=None):
return aamas2026.parse_contents(FIXTURE['contents'] if html is None else html, EVIDENCE)
def snapshots(self, folder):
folder.mkdir()
(folder/'contents.html').write_text(FIXTURE['contents'])
(folder/'receipts.json').write_text(json.dumps(FIXTURE['receipts']))
return folder
def test_every_publisher_title_author_affiliation_and_page_preserved(self):
rows, excluded, held = self.parse()
self.assertEqual((len(rows), len(excluded), len(held)), (639, 3, 1))
expected = {r['publisher_page']: r for r in FIXTURE['expected_entries']}
self.assertEqual(len(expected), 643)
all_rows = rows+excluded+held
self.assertEqual({r['metadata']['publisher_page'] for r in all_rows}, set(expected))
for r in all_rows:
e = expected[r['metadata']['publisher_page']]
self.assertEqual(r['title'], e['title'])
self.assertEqual(r['authors'], e['authors'])
self.assertEqual(r['metadata']['author_affiliations'], e['affiliations'])
self.assertEqual(r['metadata']['section_heading'], e['section'])
for r in rows:
self.assertIsNone(r['abstract'])
self.assertEqual(r['identifiers'], {})
if r['external_id'] != '2026/p3178':
self.assertEqual(r['status'], 'accepted')
self.assertNotIn('decision_date', r)
def test_explicit_withdrawal_preserves_status_date_and_no_pdf(self):
rows, _, _ = self.parse()
row, = [r for r in rows if r['external_id'] == '2026/p3178']
self.assertEqual(row['status'], 'withdrawn')
self.assertEqual(row['metadata']['withdrawal_date'], '2026-06-08')
self.assertNotIn('decision_date', row)
self.assertEqual(row['raw_decision'], 'Withdrawn June 8, 2026')
self.assertNotIn('paper_url', row['metadata'])
self.assertEqual(row['metadata']['publication_state'], 'withdrawn')
self.assertEqual(sum(r['status'] == 'accepted' for r in rows), 638)
def test_withdrawal_ingestion_retains_date_precision_without_invented_acceptance(self):
rows, _, _ = self.parse()
row, = [r for r in rows if r['external_id'] == '2026/p3178']
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); path = root/'withdrawn.jsonl'; db = root/'sample.sqlite'
path.write_text(json.dumps(row, ensure_ascii=False)+'\n')
path.with_suffix('.manifest.json').write_text(json.dumps({
'source': 'aamas_proceedings', 'list_url': aamas2026.URL,
'venue': 'AAMAS', 'year': 2026, 'track': row['track'],
'count': 1, 'status': 'partial', 'missing_abstract_count': 1,
'file_sha256': hashlib.sha256(path.read_bytes()).hexdigest()}))
ingest_file(db, path)
with sqlite3.connect(db) as c:
self.assertEqual(c.execute('SELECT status,raw_value,decision_date FROM decisions').fetchall(),
[('withdrawn', 'Withdrawn June 8, 2026', None)])
metadata = json.loads(c.execute('SELECT metadata_json FROM source_records').fetchone()[0])
self.assertEqual(metadata['withdrawal_date'], '2026-06-08')
self.assertEqual(metadata['decision_date_precision'], 'day')
self.assertEqual(c.execute('PRAGMA foreign_key_check').fetchall(), [])
def test_retraction_is_not_accepted_or_withdrawn_and_retains_date(self):
rows, _, held = self.parse()
self.assertNotIn('2026/p238', {r['external_id'] for r in rows})
h, = held
self.assertEqual(h['publication_state'], 'retracted')
self.assertEqual(h['retraction_date'], '2026-06-08')
self.assertEqual(h['raw_publication_state'], 'Retracted June 8, 2026')
self.assertNotIn('status', h)
self.assertNotIn('paper_url', h['metadata'])
self.assertEqual(h['metadata']['source_evidence'], EVIDENCE)
def test_tracks_formats_and_prior_decisions_are_not_conflated(self):
rows, _, _ = self.parse()
counts = {t: sum(r['track'] == t for r in rows) for t in {r['track'] for r in rows}}
self.assertEqual(counts, {'proceedings_unspecified': 522, 'aaai_transfer': 19,
'blue_sky': 17, 'doctoral': 34, 'demo': 44, 'jaamas': 3})
for row in rows:
self.assertEqual(row['tags'][0]['namespace'], 'aamas_proceedings:publication_format')
if row['track'] == 'aaai_transfer':
self.assertIn('none inferred', row['metadata']['prior_submission_note'])
self.assertNotIn('decision_events', row)
if row['track'] == 'jaamas':
self.assertEqual(row['metadata']['publication_format'], 'journal_presentation')
self.assertIn('not another independent', row['metadata']['track_scope_note'])
def test_refuses_changed_year_section_page_link_author_and_retraction(self):
html = FIXTURE['contents']
replacements = [('AAMAS 2026:', 'AAMAS 2027:'),
('name="R" id="R"></a><font color="#010101">Research Paper Track',
'name="R" id="R"></a><font color="#010101">Workshop Track'),
('(Page 4)', '(Page 1)'),
('../pdfs/HQQZ1937.pdf', 'https://other.example/paper.pdf'),
('Michael Wooldridge <i>', '<i>'),
('Retracted June 8, 2026', 'Withdrawn June 8, 2026')]
for old, new in replacements:
self.assertIn(old, html)
with self.subTest(change=old), self.assertRaises(ValueError):
self.parse(html.replace(old, new, 1))
def test_frozen_collection_is_partial_with_full_held_evidence(self):
with tempfile.TemporaryDirectory() as tmp, patch.object(aamas2026, 'fetch', side_effect=AssertionError('No HTTP')):
root = Path(tmp)
report = aamas.collect(2026, root/'out', snapshots=self.snapshots(root/'source'))
self.assertEqual(report['records'], 639)
self.assertEqual(report['status_counts'], {'accepted': 638, 'withdrawn': 1})
self.assertEqual(len(report['files']), 6)
self.assertEqual(len(report['held_publications']), 1)
self.assertFalse(report['database_written'])
self.assertFalse(report['pdfs_downloaded'])
for m in report['files']:
self.assertEqual(m['status'], 'partial')
self.assertEqual(m['missing_abstract_count'], m['count'])
self.assertEqual(hashlib.sha256(Path(m['file']).read_bytes()).hexdigest(), m['file_sha256'])
self.assertTrue((root/'out/aamas-proceedings-2026.json').is_file())
def test_frozen_response_rejects_tamper_unsafe_path_status_and_symlink(self):
for mode in ('tamper', 'path', 'status', 'symlink'):
with self.subTest(mode=mode), tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); source = self.snapshots(root/'source')
r = json.loads((source/'receipts.json').read_text())
if mode == 'tamper':
(source/'contents.html').write_text('bad')
elif mode == 'path':
r['receipts'][0]['file'] = '../outside.html'
elif mode == 'status':
r['receipts'][0]['status'] = 403
else:
(root/'outside.html').write_text(FIXTURE['contents'])
(source/'contents.html').unlink()
(source/'contents.html').symlink_to(root/'outside.html')
(source/'receipts.json').write_text(json.dumps(r))
with self.assertRaises(ValueError):
aamas.collect(2026, root/'out', snapshots=source)
self.assertFalse((root/'out/aamas-proceedings-2026.json').exists())
def test_live_mode_fetches_only_html_and_preserves_receipt(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); cache = root/'cache'; cache.mkdir()
receipt = {'retrieved_at': EVIDENCE['observed_at'], 'url': aamas2026.URL}
(cache/hashlib.sha256(aamas2026.URL.encode()).hexdigest()).with_suffix('.json').write_text(json.dumps(receipt))
with patch.object(aamas2026, 'fetch', return_value=FIXTURE['contents'].encode()) as fetch:
report = aamas.collect(2026, root/'out', cache=cache)
fetch.assert_called_once_with(aamas2026.URL, cache, 8*1024**2, delay=1)
self.assertEqual(report['source_receipts'][0]['response_receipt'], receipt)
def test_frozen_fixture_is_original_hashed_response(self):
r, = FIXTURE['receipts']['receipts']
self.assertEqual(hashlib.sha256(FIXTURE['contents'].encode()).hexdigest(), r['sha256'])
self.assertEqual(r['bytes'], len(FIXTURE['contents'].encode()))
+1 -1
View File
@@ -99,7 +99,7 @@ class AamasProceedingsTests(unittest.TestCase):
aamas.collect(2012, root/'out', snapshots=source)
self.assertFalse((root/'out/aamas-proceedings-2012.json').exists())
with self.assertRaises(ValueError):
aamas.collect(2025, root/'future', snapshots=source)
aamas.collect(2027, root/'future', snapshots=source)
self.assertFalse((root/'future').exists())
def test_ids_colliding_across_sections_do_not_produce_a_completed_collection(self):
+81
View File
@@ -0,0 +1,81 @@
"""Exact AMTCL volume provenance and native metadata/history preservation."""
import copy
import hashlib
import json
from pathlib import Path
import sqlite3
import tempfile
import unittest
import xml.etree.ElementTree as ET
from paper_atlas.collectors.acl import collect_xml, volume_scope, text
from paper_atlas.collectors.acl_historical import event_scope
from paper_atlas.ingestion.records import ingest_file
FIXTURE = Path(__file__).parent/'fixtures/acl-1963-earlymt.xml'
COMMIT = 'a7be623d01c48c61405dec31c871121cdbed5a01'
class Acl1963Tests(unittest.TestCase):
def setUp(self):
self.volume = ET.parse(FIXTURE).getroot().find('volume')
self.meta = self.volume.find('meta')
def test_official_snapshot_and_exact_scope(self):
self.assertEqual(hashlib.sha256(FIXTURE.read_bytes()).hexdigest(), '4a4626d792ac507de0281cb358769f7246f4a0d6b6a9176ac02e61545c1635fc')
self.assertEqual(len(self.volume.findall('paper')), 34)
self.assertEqual(volume_scope(self.meta, '1', '1963.earlymt'), ('ACL', ['ACL', 'AMTCL'], 'proceedings_unspecified'))
scope = event_scope(self.meta, '1', '1963.earlymt')
self.assertEqual(scope['original_venue'], 'EarlyMT')
self.assertEqual(scope['publication_format'], 'published_abstract')
self.assertEqual(scope['event_dates'], ['1963-08-25', '1963-08-26'])
def test_other_earlymt_collections_and_volumes_stay_excluded(self):
for collection, volume in [('1962.earlymt', '1'), ('1971.earlymt', '1'), ('1963.earlymt', '2'), ('1963.other', '1')]:
with self.subTest(collection=collection, volume=volume):
self.assertIsNone(volume_scope(self.meta, volume, collection))
self.assertIsNone(volume_scope(self.meta, '1'))
def test_scope_metadata_drift_and_duplicates_are_rejected(self):
for field in ['venue', 'year', 'booktitle', 'address', 'month']:
for duplicate in [False, True]:
meta = copy.deepcopy(self.meta)
if duplicate:
ET.SubElement(meta, field).text = text(meta.find(field))
else:
meta.find(field).text = 'changed'
with self.subTest(field=field, duplicate=duplicate), self.assertRaises(ValueError):
volume_scope(meta, '1', '1963.earlymt')
def test_every_original_contribution_survives_collection(self):
with tempfile.TemporaryDirectory() as tmp:
manifest, = collect_xml(FIXTURE, tmp, COMMIT)
rows = [json.loads(raw) for raw in Path(manifest['file']).read_text().splitlines()]
self.assertEqual(manifest['count'], 34)
self.assertEqual(manifest['missing_abstract_count'], 0)
self.assertEqual(manifest['excluded_materials'], [])
for paper, row in zip(self.volume.findall('paper'), rows):
self.assertEqual(row['external_id'], '1963.earlymt-1.'+paper.attrib['id'])
self.assertEqual(row['title'], text(paper.find('title')))
self.assertEqual(row['abstract'], text(paper.find('abstract')))
self.assertEqual(row['authors'], [{'given':text(a.find('first')), 'family':text(a.find('last'))} for a in paper.findall('author')])
self.assertEqual(row['metadata']['venue_codes'], ['earlymt'])
self.assertEqual(row['metadata']['publication_format'], 'published_abstract')
self.assertEqual(row['tags'], [{'namespace':'acl_anthology:publication_format','value':'published_abstract'}])
self.assertEqual((row['venue'], row['track'], row['status']), ('ACL', 'proceedings_unspecified', 'accepted'))
def test_native_ingestion_is_idempotent_and_preserves_abstracts_and_history(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
manifest, = collect_xml(FIXTURE, root/'source', COMMIT)
db = root/'sample.sqlite'
ingest_file(db, manifest['file'])
ingest_file(db, manifest['file'])
with sqlite3.connect(db) as c:
for table in ['papers', 'source_records', 'submissions', 'decisions']:
self.assertEqual(c.execute('SELECT count(*) FROM '+table).fetchone()[0], 34)
self.assertEqual(c.execute("SELECT count(*) FROM papers WHERE abstract IS NOT NULL AND abstract!=''").fetchone()[0], 34)
self.assertEqual(c.execute("SELECT DISTINCT status FROM decisions").fetchall(), [('accepted',)])
self.assertEqual(c.execute("SELECT v.acronym,e.year,e.track FROM editions e JOIN venues v ON v.id=e.venue_id").fetchall(), [('ACL',1963,'proceedings_unspecified')])
self.assertIsNone(c.execute("SELECT 1 FROM venue_aliases WHERE alias='EarlyMT'").fetchone())
self.assertEqual(c.execute("SELECT count(*) FROM paper_tags pt JOIN tags t ON t.id=pt.tag_id WHERE t.namespace='acl_anthology:publication_format' AND t.value='published_abstract'").fetchone()[0], 34)
+114
View File
@@ -0,0 +1,114 @@
"""Pinned T78 evidence, edition-local aliases and an explicitly identified material."""
import copy
import hashlib
import json
from pathlib import Path
import sqlite3
import tempfile
import unittest
import xml.etree.ElementTree as ET
from paper_atlas.collectors.acl import collect_xml, volume_scope
from paper_atlas.collectors.acl_historical import event_scope, material_reason
from paper_atlas.db.store import Store
from paper_atlas.ingestion.records import ingest_file
FIXTURE = Path(__file__).parent/'fixtures/acl-t78.xml'
COMMIT = 'a7be623d01c48c61405dec31c871121cdbed5a01'
class AclHistoricalTests(unittest.TestCase):
def setUp(self):
self.root = ET.parse(FIXTURE).getroot()
self.volume = self.root.find('volume')
self.meta = self.volume.find('meta')
def test_frozen_volume_matches_official_snapshot(self):
self.assertEqual(hashlib.sha256(FIXTURE.read_bytes()).hexdigest(), 'f712f94cff0cba05f786b7ac31dad2ea9408fde2a17a04531130df623f57dd84')
self.assertEqual(len(self.volume.findall('paper')), 36)
self.assertEqual(volume_scope(self.meta, '1', 'T78'), ('ACL+TINLAP', ['ACL', 'TINLAP'], 'proceedings_unspecified'))
def test_unknown_year_collection_or_volume_is_not_globally_aliased(self):
for collection, volume in [('T75', '1'), ('T87', '1'), ('T78', '2'), ('C65', '1')]:
with self.subTest(collection=collection, volume=volume):
self.assertIsNone(event_scope(self.meta, volume, collection))
self.assertIsNone(volume_scope(self.meta, volume, collection))
self.assertIsNone(volume_scope(self.meta, '1'))
def test_known_volume_scope_rejects_critical_metadata_drift(self):
for field, replacement in [('venue', 'acl'), ('year', '1979'), ('booktitle', 'Another TINLAP'), ('editor/first', 'Another')]:
changed = copy.deepcopy(self.meta)
changed.find(field).text = replacement
with self.subTest(field=field), self.assertRaises(ValueError):
event_scope(changed, '1', 'T78')
changed = copy.deepcopy(self.meta)
ET.SubElement(changed, 'year').text = '1978'
with self.assertRaises(ValueError):
event_scope(changed, '1', 'T78')
def test_evidence_retains_original_series_dates_and_role_boundary(self):
scope = event_scope(self.meta, '1', 'T78')
self.assertEqual(scope['original_venue'], 'TINLAP')
self.assertEqual(scope['event_dates'], ['1978-07-25', '1978-07-27'])
self.assertEqual([e['pdf_pages'] for e in scope['evidence']], [[9, 10], [3]])
self.assertIn('not identified', scope['track_scope_note'])
self.assertIn('pending', scope['evidence'][0]['scope'])
def test_only_exact_session_questions_material_is_excluded(self):
paper = copy.deepcopy(self.volume.findall('paper')[-1])
self.assertIn('Session question list', material_reason('T78', '1', paper))
self.assertIsNone(material_reason('C65', '1', paper))
self.assertIsNone(material_reason('T78', '2', paper))
paper.set('id', '37')
self.assertIsNone(material_reason('T78', '1', paper))
paper.set('id', '36')
ET.SubElement(paper, 'author')
with self.assertRaises(ValueError):
material_reason('T78', '1', paper)
def test_all_authored_source_fields_and_material_receipt_survive_collection(self):
with tempfile.TemporaryDirectory() as temporary:
manifest, = collect_xml(FIXTURE, temporary, COMMIT)
rows = [json.loads(raw) for raw in Path(manifest['file']).read_text().splitlines()]
self.assertEqual(manifest['count'], 35)
self.assertEqual(manifest['xml_paper_elements'], 36)
self.assertEqual(manifest['missing_abstract_count'], 35)
self.assertEqual(manifest['excluded_materials'][0]['external_id'], 'T78-1036')
for number, row in enumerate(rows, 1):
paper = self.volume.findall('paper')[number-1]
self.assertEqual(row['external_id'], f'T78-1{number:03d}')
self.assertEqual(row['title'], ' '.join(''.join(paper.find('title').itertext()).split()))
self.assertEqual(row['metadata']['venue_codes'], ['tinlap'])
self.assertEqual(row['metadata']['historical_event_scope']['original_venue'], 'TINLAP')
self.assertEqual(row['metadata']['metadata_commit'], COMMIT)
self.assertEqual((row['status'], row['track'], row['abstract']), ('accepted', 'proceedings_unspecified', None))
def test_old_coling_scope_is_unchanged_by_calendar_replacement_evidence(self):
meta = ET.fromstring('<meta><venue>coling</venue><year>1965</year><booktitle>COLING 1965</booktitle></meta>')
self.assertEqual(volume_scope(meta, '1', 'C65'), ('COLING', ['COLING'], 'main'))
self.assertIsNone(event_scope(meta, '1', 'C65'))
def test_native_ingestion_does_not_alias_other_tinlap_years_or_infer_negative_status(self):
with tempfile.TemporaryDirectory() as temporary:
root = Path(temporary)
manifest, = collect_xml(FIXTURE, root/'source', COMMIT)
db = root/'sample.sqlite'
store = Store(db)
pid, rid = store.record('test_control', 'tinlap1975', 'https://example.org/tinlap1975',
'An earlier TINLAP contribution', None, ['Jane Doe'])
store.decision(pid, rid, 'TINLAP', 1975, 'main', 'tinlap1975', 'https://example.org/tinlap1975', 'accepted', 'test control')
store.conn.commit()
store.conn.close()
ingest_file(db, manifest['file'])
ingest_file(db, manifest['file'])
with sqlite3.connect(db) as c:
self.assertEqual(c.execute('SELECT count(*) FROM papers').fetchone()[0], 36)
self.assertEqual(c.execute('SELECT count(*) FROM submissions').fetchone()[0], 36)
self.assertEqual(c.execute('SELECT count(*) FROM decisions').fetchone()[0], 36)
self.assertEqual(c.execute("SELECT count(*) FROM decisions WHERE status!='accepted'").fetchone()[0], 0)
self.assertIsNone(c.execute("SELECT 1 FROM source_records WHERE external_id='T78-1036'").fetchone())
aliases = c.execute('SELECT v.acronym,a.alias FROM venue_aliases a JOIN venues v ON v.id=a.venue_id ORDER BY a.alias').fetchall()
self.assertEqual(aliases, [('ACL+TINLAP', 'ACL'), ('ACL+TINLAP', 'TINLAP')])
metadata = json.loads(c.execute("SELECT metadata_json FROM source_records WHERE external_id='T78-1001'").fetchone()[0])
self.assertEqual(metadata['historical_event_scope']['event_year'], 1978)
self.assertEqual(c.execute('PRAGMA foreign_key_check').fetchall(), [])
+75
View File
@@ -0,0 +1,75 @@
import gzip
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import corl2026 as c
class CoRL2026Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.bundle = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/corl2026-source.json.gz').read_bytes()))
def test_official_census_and_presentation_dedup(self):
program = c.parse_program(self.bundle['official_html'])
self.assertEqual(len(program), 687)
self.assertEqual(sum(len(p['presentations']) for p in program.values()), 780)
self.assertEqual(sum(len(p['presentations']) == 2 for p in program.values()), 93)
def test_conflicting_official_title_is_not_silently_folded(self):
html = self.bundle['official_html']
title = 'Diagnosing Compositional Generalization in Sequential Robot Tasks'
self.assertIn(title, html)
with self.assertRaises(ValueError):
c.parse_program(html.replace(title, 'Different paper', 1))
def test_foreign_forum_source_is_rejected(self):
program = c.parse_program(self.bundle['official_html']); archive = json.loads(self.bundle['filtered'])
archive['papers'][0]['author_source'] = 'https://openreview.net/forum?id=WrongPaper'
with self.assertRaisesRegex(ValueError, 'another submission'):
c.join_metadata(program, archive)
def test_unknown_profile_fields_are_rejected(self):
program = c.parse_program(self.bundle['official_html']); archive = json.loads(self.bundle['filtered'])
archive['papers'][0]['authorids'] = ['profile']
with self.assertRaisesRegex(ValueError, 'profile'):
c.join_metadata(program, archive)
def test_source_sets_must_agree(self):
program = c.parse_program(self.bundle['official_html']); archive = json.loads(self.bundle['filtered'])
archive['papers'].pop()
with self.assertRaisesRegex(ValueError, 'forum sets'):
c.join_metadata(program, archive)
def test_complete_snapshot_and_explicit_version_provenance(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); official = root/'official'; archive = root/'archive'
official.mkdir(); archive.mkdir()
(official/'accepted.html').write_text(self.bundle['official_html'])
(official/'research.json').write_text(json.dumps(self.bundle['research']))
(archive/'explorer-paper-metadata-filtered-v1.json').write_text(self.bundle['filtered'])
out = root/'out'; report = c.collect(out, official_snapshots=official, archive_snapshots=archive)
self.assertEqual(report['records'], 687); self.assertEqual(len(report['title_variants']), 34)
self.assertEqual(report['public_rejected_availability'], 'unknown')
rows = [json.loads(l) for l in (out/'corl-program-archive-2026-main.jsonl').read_text().splitlines()]
self.assertEqual(len({r['external_id'] for r in rows}), 687)
self.assertTrue(all(set(r['identifiers']) == {'openreview'} for r in rows))
self.assertTrue(all(r['submission_identifiers'] == [{'scheme': 'openreview', 'value': r['identifiers']['openreview']}] for r in rows))
self.assertTrue(all(not r['tags'] and not r['metadata']['original_decision_signature_verified'] for r in rows))
self.assertTrue(all(r['title'] == r['metadata']['archive_fields']['title'] for r in rows))
self.assertTrue(all(r['authors'] and r['abstract'] for r in rows))
self.assertFalse(report['database_written']); self.assertFalse(report['pdfs_downloaded'])
with self.assertRaisesRegex(ValueError, 'Output exists'):
c.collect(out, official_snapshots=official, archive_snapshots=archive)
(official/'accepted.html').write_text('tampered')
with self.assertRaisesRegex(ValueError, 'hash changed'):
c.collect(root/'failed', official_snapshots=official, archive_snapshots=archive)
self.assertTrue((root/'failed/failed.json').exists())
self.assertFalse((root/'failed/collection-report.json').exists())
def test_forum_identity_validation(self):
for bad in ['https://openreview.net/challenge?redirect=forum', 'https://evil.test/forum?id=abcdefgh', 'https://openreview.net/forum?id=abcdefgh&other=1']:
with self.assertRaises(ValueError):
c.forum_id(bad)
+141
View File
@@ -0,0 +1,141 @@
import gzip
import hashlib
import json
from pathlib import Path
import sqlite3
import tempfile
import unittest
from unittest.mock import patch
from paper_atlas.collectors.dblp import catalogue
from paper_atlas.collectors.dblp_recovery import recover
from paper_atlas.collectors.dblp_scope import scope
from paper_atlas.ingestion.records import ingest_file
class DblpRecoveryTests(unittest.TestCase):
def setUp(self):
self.tmp = tempfile.TemporaryDirectory()
self.addCleanup(self.tmp.cleanup)
self.root = Path(self.tmp.name)
self.dtd = self.root / 'dblp.dtd'
self.dtd.write_bytes(b'<!ENTITY eacute "&#233;">')
self.archive = self.root / 'dblp.xml.gz'
# These include a keynote and a workshop, neither a main-paper inference.
body = '''<proceedings key="conf/ifaamas/2025"><title>AAMAS 2025</title><year>2025</year></proceedings>
<inproceedings key="conf/ifaamas/keynote"><author>Ren&eacute;</author><title>Keynote: Agents</title><year>2025</year><booktitle>AAMAS</booktitle><crossref>conf/ifaamas/2025</crossref></inproceedings>
<inproceedings key="conf/ifaamas/paper"><author>Alice Doe</author><title>Research <i>agents</i></title><year>2025</year><booktitle>AAMAS</booktitle><crossref>conf/ifaamas/2025</crossref><ee>https://dl.acm.org/doi/10.5555/3709347.123</ee></inproceedings>
<proceedings key="conf/ifaamas/2025w"><title>AAMAS Workshop</title><year>2025</year></proceedings>
<inproceedings key="conf/ifaamas/workshop"><title>Workshop paper</title><year>2025</year><booktitle>AAMAS Workshop</booktitle><crossref>conf/ifaamas/2025w</crossref></inproceedings>
<inproceedings key="conf/unrelated/other"><title>Other family</title><year>2025</year></inproceedings>'''
with gzip.open(self.archive, 'wb') as stream:
stream.write(('<?xml version="1.0"?><!DOCTYPE dblp SYSTEM "dblp.dtd"><dblp>'
+ body + '</dblp>').encode())
self.sha = hashlib.sha256(self.archive.read_bytes()).hexdigest()
self.md5 = hashlib.md5(self.dtd.read_bytes()).hexdigest()
self.manifest = catalogue(self.archive, self.dtd, self.root / 'catalogue',
self.sha, self.md5)
self.catalogue = Path(self.manifest['catalogue'])
self.manifest_path = self.catalogue.with_name('dblp-ai-candidates.manifest.json')
def run_recovery(self, **kwargs):
options = dict(expected_sha=self.sha, expected_dtd_md5=self.md5)
options.update(kwargs)
return recover(self.archive, self.dtd, self.catalogue, self.root / 'recovered',
['ifaamas'], **options)
def test_fresh_discovery_and_recovery_from_old_candidate_omission(self):
self.assertEqual(self.manifest['candidate_family_counts']['ifaamas'], 3)
# Simulate an older filter without altering its complete catalogue.
manifest = dict(self.manifest)
manifest['candidate_family_counts'] = {}
self.manifest_path.write_text(json.dumps(manifest))
candidate = Path(manifest['file'])
candidate.write_text('old incomplete candidate file\n')
before = {p: p.read_bytes() for p in [self.archive, self.dtd, self.catalogue,
self.manifest_path, candidate]}
with patch('urllib.request.urlopen', side_effect=AssertionError('No network')):
report = self.run_recovery()
rows = [json.loads(line) for line in Path(report['file']).read_text().splitlines()]
self.assertEqual(report['recovered_publications'], 3)
self.assertEqual(report['recovered_volumes'], 2)
self.assertEqual(report['recovered_records'], 5)
self.assertEqual(report['records_scanned'], 6)
self.assertEqual(report['old_candidate_family_counts'], {'ifaamas': 0})
self.assertFalse(report['database_written'])
self.assertEqual(next(r for r in rows if r['key'].endswith('/keynote'))['fields']['author'], ['René'])
self.assertTrue(any(r['key'].endswith('/workshop') for r in rows))
self.assertTrue(all(not ({'source', 'status', 'venue', 'track'} & r.keys()) for r in rows))
publication = next(r for r in rows if r['key'].endswith('/paper'))
volume = next(r for r in rows if r['key'] == 'conf/ifaamas/2025')
self.assertEqual(scope(publication, volume), (None, 'outside_target_family'))
self.assertEqual({p: p.read_bytes() for p in before}, before)
self.assertEqual(hashlib.sha256(Path(report['file']).read_bytes()).hexdigest(),
report['file_sha256'])
# Raw recovery files cannot accidentally enter the normalized writer.
with patch('paper_atlas.ingestion.records.open_store') as writer:
with self.assertRaisesRegex(ValueError, 'source manifest'):
ingest_file(self.root / 'never.sqlite', report['file'])
writer.assert_not_called()
self.assertFalse((self.root / 'never.sqlite').exists())
def test_checksum_mismatch_does_not_publish(self):
for options in [{'expected_sha': '0' * 64}, {'expected_dtd_md5': '0' * 32}]:
with self.subTest(options=options), self.assertRaisesRegex(ValueError, 'checksum'):
self.run_recovery(**options)
self.assertFalse((self.root / 'recovered').exists())
def test_wrong_catalogue_snapshot_and_incomplete_totals_are_rejected(self):
for changes in [{'snapshot_sha256': '0' * 64}, {'dtd_md5': '0' * 32},
{'records_scanned': 99}, {'record_types': {'proceedings': 2}}]:
manifest = {**self.manifest, **changes}
self.manifest_path.write_text(json.dumps(manifest))
with self.subTest(changes=changes), self.assertRaises(ValueError):
self.run_recovery()
self.assertFalse((self.root / 'recovered').exists())
def test_changed_family_count_does_not_publish_partial_result(self):
with sqlite3.connect(self.catalogue) as c:
c.execute("UPDATE family_counts SET count=count+1 WHERE family='ifaamas' AND record_type='inproceedings'")
with self.assertRaisesRegex(ValueError, 'family totals'):
self.run_recovery()
self.assertFalse((self.root / 'recovered').exists())
def test_changed_volume_metadata_is_detected(self):
with sqlite3.connect(self.catalogue) as c:
row = json.loads(c.execute("SELECT metadata_json FROM proceedings WHERE key='conf/ifaamas/2025'").fetchone()[0])
row['fields']['title'] = ['Wrong volume']
c.execute("UPDATE proceedings SET metadata_json=? WHERE key='conf/ifaamas/2025'", (json.dumps(row),))
with self.assertRaisesRegex(ValueError, 'proceedings differs'):
self.run_recovery()
self.assertFalse((self.root / 'recovered').exists())
def test_truncated_gzip_never_publishes(self):
self.archive.write_bytes(self.archive.read_bytes()[:-8])
revised_sha = hashlib.sha256(self.archive.read_bytes()).hexdigest()
self.manifest_path.write_text(json.dumps({**self.manifest, 'snapshot_sha256': revised_sha}))
with self.assertRaises((EOFError, OSError)):
self.run_recovery(expected_sha=revised_sha)
self.assertFalse((self.root / 'recovered').exists())
def test_existing_output_is_preserved_and_unknown_family_is_rejected(self):
out = self.root / 'recovered'
out.mkdir()
sentinel = out / 'keep'
sentinel.write_text('existing')
with self.assertRaisesRegex(ValueError, 'already exist'):
self.run_recovery()
self.assertEqual(sentinel.read_text(), 'existing')
for names in [[], ['../ifaamas'], ['not-a-supported-family'], [None]]:
with self.subTest(names=names), self.assertRaises(ValueError):
recover(self.archive, self.dtd, self.catalogue, self.root / 'other', names)
def test_requested_family_missing_from_catalogue_is_explicit(self):
with self.assertRaisesRegex(ValueError, 'absent from complete catalogue'):
recover(self.archive, self.dtd, self.catalogue, self.root / 'recovered',
['ifaamas', 'icml'], expected_sha=self.sha, expected_dtd_md5=self.md5)
self.assertFalse((self.root / 'recovered').exists())
if __name__ == '__main__':
unittest.main()
+139
View File
@@ -0,0 +1,139 @@
import copy
import gzip
import json
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
from paper_atlas.collectors import eccv2026 as c
from paper_atlas.io.html_cache import PublicHTMLCache
class ECCV2026Tests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.bundle = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/eccv2026-source.json.gz').read_bytes()))
cls.program = c.parse_program(cls.bundle['official_pages']['accepted.html'])
def snapshots(self, root):
official = root/'official'; paper = root/'paper'; official.mkdir(); paper.mkdir()
for name, raw in self.bundle['official_pages'].items():
(official/name).write_bytes(raw.encode('utf-8'))
(official/'manifest.json').write_bytes(self.bundle['official_manifest'].encode('utf-8'))
for pid, raw in self.bundle['paper_pages'].items():
(paper/(pid+'.html')).write_bytes(raw.encode('utf-8'))
(paper/'manifest.json').write_text(json.dumps(self.bundle['paper_manifest']))
return official, paper
def test_complete_program_and_duplicate_occurrences_match_gold(self):
self.assertEqual(len(self.program), 2834)
self.assertEqual(sum(len(p['row_ordinals']) for p in self.program.values()), 2851)
for ordinal, gold in enumerate(self.bundle['inventory']['records'], 1):
item = self.program[gold['paper_id']]
self.assertEqual(item['listing'], {k: gold[k] for k in ('title','authors_literal','keywords_literal','presentation_literal')})
self.assertIn(ordinal, item['row_ordinals'])
def test_conflicting_duplicate_not_silently_folded(self):
title = 'Transferability Between Understanding and Generation in Unified Multimodal Models'
with self.assertRaisesRegex(ValueError, 'Conflicting'):
c.parse_program(self.bundle['official_pages']['accepted.html'].replace('href="/virtual/2026/poster/3137">'+title, 'href="/virtual/2026/poster/3137">Conflicting title', 1))
def test_missing_member_and_changed_provisional_status_rejected(self):
html = self.bundle['official_pages']['accepted.html']
for changed in [html.replace('/virtual/2026/poster/4048', '/virtual/2024/poster/4048', 1),
html.replace('This paper list is preliminary pending publisher checks.', 'Final archival papers.')]:
with self.assertRaises(ValueError):
c.parse_program(changed)
def test_public_page_fields_match_independent_sample_review(self):
for gold in self.bundle['paper_gold']['records']:
pid = gold['paper_id']; fields = c.parse_paper(self.bundle['paper_pages'][pid], gold['url'], self.program[pid])
self.assertEqual(fields['title'], gold['title']); self.assertEqual(fields['authors'], gold['authors'])
self.assertEqual(fields['abstract'], gold['abstract_literal']); self.assertFalse(fields['review_flags'])
self.assertIn('sig-nal', c.parse_paper(self.bundle['paper_pages']['4048'], self.program['4048']['url'], self.program['4048'])['abstract'])
def test_foreign_canonical_and_inconsistent_jsonld_author_rejected(self):
raw = self.bundle['paper_pages']['4048']; url = self.program['4048']['url']
for changed in [raw.replace(url, 'https://example.org/other'), raw.replace('Suhyeon Ha', 'Other Author', 1)]:
with self.assertRaises(ValueError):
c.parse_paper(changed, url, self.program['4048'])
def test_program_and_page_versions_flagged_without_aliases(self):
program = copy.deepcopy(self.program['4048']); program['listing']['title'] = 'Earlier source title'
fields = c.parse_paper(self.bundle['paper_pages']['4048'], program['url'], program)
self.assertEqual(fields['review_flags'], ['program_and_page_title_versions_differ_requires_review'])
self.assertEqual(fields['title'], self.program['4048']['listing']['title'])
def test_partial_snapshot_collection_has_no_inferred_submission_ids(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); official, paper = self.snapshots(root)
report = c.collect(root/'out', official_snapshots=official, paper_snapshots_dir=paper)
self.assertEqual(report['records'], 3); self.assertEqual(len(report['uncollected_program_ids']), 2831)
self.assertEqual(report['public_rejected_decision_metadata'], 'unknown'); self.assertFalse(report['database_written'])
manifest, = report['files']; self.assertEqual(manifest['status'], 'partial'); self.assertEqual(manifest['source_expected_count'], 2834)
rows = [json.loads(l) for l in Path(manifest['file']).read_text().splitlines()]
self.assertEqual({r['external_id'] for r in rows}, {'2026/4048','2026/3137','2026/3652'})
self.assertTrue(all(not r['identifiers'] and not r['submission_identifiers'] and r['track']=='program_unclassified' for r in rows))
self.assertTrue(all(r['metadata']['publication_state']=='preliminary_pending_publisher_checks' and not r['metadata']['original_decision_signature_verified'] for r in rows))
self.assertTrue(all(t['namespace']=='eccv_program:keyword' for r in rows for t in r['tags']))
with self.assertRaisesRegex(ValueError, 'Output exists'):
c.collect(root/'out', official_snapshots=official, paper_snapshots_dir=paper)
def test_zero_network_budget_reuses_immutable_cache_only(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); official, _ = self.snapshots(root); client = PublicHTMLCache(root/'cache', c.ORIGIN)
for r in self.bundle['paper_manifest']['records']:
body, receipt, _ = client.paths(r['url']); body.write_text(self.bundle['paper_pages'][r['paper_id']]); receipt.write_text(json.dumps({**r,'retrieved_at':self.bundle['paper_manifest']['at']}))
with patch.object(PublicHTMLCache, 'get', side_effect=AssertionError('network forbidden')):
report = c.collect(root/'out', official_snapshots=official, cache=root/'cache', max_new_pages=0)
self.assertEqual((report['records'],report['new_pages'],report['reused_pages']), (3,0,3))
def test_tampered_snapshot_preserves_failure_without_success(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); official, paper = self.snapshots(root); (paper/'4048.html').write_text('tampered')
with self.assertRaises(ValueError):
c.collect(root/'out', official_snapshots=official, paper_snapshots_dir=paper)
self.assertTrue((root/'out/failed.json').exists()); self.assertFalse((root/'out/collection-report.json').exists())
def test_structured_math_markup_requires_explicit_review(self):
raw = self.bundle['paper_pages']['4048']
self.assertIn('<p>Proactive tamper', raw)
fields = c.parse_paper(raw.replace('<p>Proactive tamper', '<p>10<sup>6</sup> Proactive tamper', 1), self.program['4048']['url'], self.program['4048'])
self.assertIn('structured_abstract_markup_requires_review', fields['review_flags'])
self.assertEqual(fields['abstract_markup_tags'], ['sup'])
def test_fixture_preserves_exact_http_bytes_including_crlf(self):
import hashlib
for receipt in json.loads(self.bundle['official_manifest'])['sources']:
raw = self.bundle['official_pages'][receipt['file']].encode('utf-8')
self.assertEqual(len(raw), receipt['bytes'])
self.assertEqual(hashlib.sha256(raw).hexdigest(), receipt['sha256'])
for receipt in self.bundle['paper_manifest']['records']:
raw = self.bundle['paper_pages'][receipt['paper_id']].encode('utf-8')
self.assertEqual(hashlib.sha256(raw).hexdigest(), receipt['sha256'])
def test_real_double_encoded_author_requires_exact_visible_agreement(self):
import hashlib
sample = self.bundle['encoding_sample']; pid = sample['paper_id']; raw = sample['html']
self.assertEqual(hashlib.sha256(raw.encode('utf-8')).hexdigest(), sample['receipt']['sha256'])
self.assertEqual(sample['receipt']['sha256'], 'b575318fa569e83eea5e96f937dd60f078fbed482877318013f797c16a02ff09')
fields = c.parse_paper(raw, sample['receipt']['url'], self.program[pid])
self.assertEqual(fields['authors'], sample['gold']['authors'])
self.assertEqual(fields['jsonld_raw_text']['author_names'][0], 'Zi&amp;#x27;ang Lu')
self.assertIn('jsonld_display_text_normalized_requires_review', fields['review_flags'])
# Real changes to the author or an extra encoding layer remain errors.
for replacement in ('Other Author', 'Zi&amp;amp;#x27;ang Lu'):
with self.assertRaisesRegex(ValueError, 'authors disagree'):
c.parse_paper(raw.replace('Zi&amp;#x27;ang Lu', replacement), sample['receipt']['url'], self.program[pid])
def test_real_already_agreeing_literal_title_is_not_decoded_again(self):
import hashlib
sample = self.bundle['literal_title_sample']; pid = sample['paper_id']; raw = sample['html']
self.assertEqual(hashlib.sha256(raw.encode('utf-8')).hexdigest(), 'c208525ad5f02b4ca274dff7e24a0392dabdc55bb3620497079a84df81a02a72')
fields = c.parse_paper(raw, sample['receipt']['url'], self.program[pid])
self.assertIn('&amp;', fields['title'])
self.assertEqual(fields['title'], sample['gold']['visible_title'])
self.assertEqual(fields['jsonld_raw_text']['name'], sample['gold']['jsonld_title_raw'])
self.assertNotEqual(fields['title'], sample['gold']['blind_double_decoded_title'])
self.assertNotIn('jsonld_display_text_normalized_requires_review', fields['review_flags'])
+137
View File
@@ -0,0 +1,137 @@
"""Checks for published ECCV metadata and preserved submission histories."""
from hashlib import sha256
import json
from pathlib import Path
import sqlite3
import tempfile
import unittest
from paper_atlas.collectors.eccv2026_publications import BOOK_TITLE, SOURCE, collect, publisher_row
from paper_atlas.db.store import Store
from paper_atlas.ingestion.records import ingest_file
FIRST_BOOK = '10.1007/978-3-032-10000-0'
FIRST_DOI = FIRST_BOOK + '_1'
def snapshots(root):
toc, chapters = root / 'toc', root / 'chapters'
toc.mkdir()
chapters.mkdir()
receipts, volumes = [], {}
for offset in range(78):
volume = 17001 + offset
book = f'10.1007/978-3-032-{10000 + offset}-0'
book_url = 'https://link.springer.com/book/' + book
count = 37 if offset < 27 else 36
files, chapter_dois = {}, []
for page, indices in ((1, range(1, 20)), (2, range(20, count + 1))):
filename = f'{volume}-{page}.html'
html = f'<h1>{BOOK_TITLE}</h1><p>Malmö (LNCS, volume {volume})</p>'
html += '<li data-test="chapter"><h3>Front Matter</h3></li>'
for i in indices:
doi = f'{book}_{i}'
html += f'<li data-test="chapter"><h3><a href="/chapter/{doi}">Title {volume}-{i}</a></h3></li>'
chapter_dois.append(doi)
raw = html.encode()
(toc / filename).write_bytes(raw)
files[str(page)] = filename
receipts.append({'file': filename, 'status': 200, 'bytes': len(raw), 'sha256': sha256(raw).hexdigest(),
'url': book_url + ('?page=2' if page == 2 else '')})
volumes[str(volume)] = {'book': book_url, 'files': files, 'chapter_dois': chapter_dois}
data = ''.join(json.dumps(row) + '\n' for row in receipts).encode()
(toc / 'receipts.jsonl').write_bytes(data)
checkpoint = json.dumps(volumes).encode()
(toc / 'volume-checkpoint.json').write_bytes(checkpoint)
(toc / 'summary.json').write_text(json.dumps({
'raw_receipts_sha256': sha256(data).hexdigest(),
'volume_checkpoint_sha256': sha256(checkpoint).hexdigest(),
'chapter_link_count': 2835,
}))
url = 'https://link.springer.com/chapter/' + FIRST_DOI
citation = {
'citation_doi': FIRST_DOI, 'citation_title': 'Title 17001-1',
'citation_inbook_title': BOOK_TITLE, 'citation_publication_date': '2026',
'citation_firstpage': '1', 'citation_lastpage': '10',
'citation_author': 'Chen, Lei',
}
body = ''.join(f'<meta name="{k}" content="{v}">' for k, v in citation.items())
body += '<div id="Abs1-content"><p>Published abstract.</p></div>'
raw = body.encode()
(chapters / 'first.html').write_bytes(raw)
(chapters / 'receipts.json').write_text(json.dumps({'responses': [{
'url': url, 'final_url': url, 'file': 'first.html', 'at': '2026-11-18T00:00:00Z',
'http_status': 200, 'bytes': len(raw), 'sha256': sha256(raw).hexdigest(),
'headers': {'Content-Type': 'text/html'},
}]}))
return {'toc_snapshots': toc, 'chapter_snapshots': chapters}
class ECCV2026PublicationsTests(unittest.TestCase):
def test_frozen_snapshot_and_existing_history(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
source = snapshots(root)
report = collect(root / 'out', **source)
self.assertEqual((report['toc_chapters'], report['chapter_details_missing']), (2835, 2834))
manifest, = report['files']
self.assertEqual((manifest['track'], manifest['status']), ('main', 'partial'))
row = json.loads(Path(manifest['file']).read_text())
self.assertEqual(row['identifiers'], {'doi': FIRST_DOI})
self.assertEqual(row['submission_identifiers'], [{'scheme': 'publication_doi', 'value': FIRST_DOI}])
self.assertEqual(row['authors'], [{'family': 'Chen', 'given': 'Lei'}])
self.assertEqual(row['abstract'], 'Published abstract.')
self.assertEqual(row['metadata']['lncs_volume'], 17001)
self.assertFalse(row['metadata']['original_decision_signature_verified'])
detail = row['metadata']['publisher_chapter_evidence']
self.assertEqual(sha256((root / 'out' / detail['file']).read_bytes()).hexdigest(), detail['sha256'])
db = root / 'example.sqlite'
store = Store(db)
pid, rid = store.record('prior', 'work', 'https://example.org/work',
row['title'], 'Original preprint abstract.', row['authors'],
{'arxiv': '2601.00001'})
store.decision(pid, rid, 'ICLR', 2026, 'main', 'work', 'https://example.org/decision',
'rejected', 'Original ICLR result.')
store.conn.commit()
store.conn.close()
row['identifiers']['arxiv'] = '2601.00001'
path = Path(manifest['file'])
raw = (json.dumps(row) + '\n').encode()
path.write_bytes(raw)
manifest['file_sha256'] = sha256(raw).hexdigest()
path.with_suffix('.manifest.json').write_text(json.dumps(manifest))
ingest_file(db, path)
ingest_file(db, path)
with sqlite3.connect(db) as conn:
self.assertEqual(conn.execute('SELECT id,abstract FROM papers').fetchall(),
[(pid, 'Original preprint abstract.')])
self.assertEqual(conn.execute('SELECT status FROM decisions ORDER BY id').fetchall(),
[('rejected',), ('accepted',)])
self.assertEqual(conn.execute('SELECT scheme,value FROM submission_identifiers').fetchall(),
[('publication_doi', FIRST_DOI)])
self.assertEqual(conn.execute('SELECT name FROM sources ORDER BY id').fetchall(), [('prior',), (SOURCE,)])
with self.assertRaises(FileExistsError):
collect(root / 'out', **source)
def test_numeric_superscript_wrappers_preserve_both_title_literals(self):
chapter = {'doi': FIRST_DOI, 'title': 'Example $$^2$$ : Formal title',
'authors': [], 'abstract': 'Published abstract.', 'authors_citation_raw': [],
'first_page': '1', 'last_page': '10'}
toc = {'title': r'Example \(^2\) : Formal title', 'book_doi': FIRST_BOOK, 'lncs_volume': 17001,
'evidence_url': 'https://link.springer.com/book/' + FIRST_BOOK, 'evidence_sha256': 'a' * 64}
evidence = {'observed_at': '2026-11-18T00:00:00Z'}
row = publisher_row(chapter, toc, evidence)
self.assertEqual(row['title'], chapter['title'])
self.assertEqual(row['metadata']['publisher_contents_evidence']['title_literal'], toc['title'])
with self.assertRaisesRegex(ValueError, 'title differs'):
publisher_row(chapter, {**toc, 'title': r'Example \(^3\) : Formal title'}, evidence)
def test_changed_contents_receipt_stops_before_output(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
source = snapshots(root)
(source['toc_snapshots'] / '17001-1.html').write_text('unverified bytes')
with self.assertRaisesRegex(ValueError, 'contents bytes disagree'):
collect(root / 'out', **source)
self.assertFalse((root / 'out').exists())
+68
View File
@@ -0,0 +1,68 @@
import io
import json
import sqlite3
import unittest
from unittest.mock import Mock, patch
from paper_atlas.audits import global_identity
class GlobalIdentityCandidatesTest(unittest.TestCase):
def test_exact_same_title_and_near_title_require_author_evidence(self):
output = io.StringIO()
with sqlite3.connect(':memory:') as scratch:
scratch.execute('CREATE TABLE titles (id INTEGER, title_key TEXT, authors BLOB)')
scratch.executemany('INSERT INTO titles VALUES (?,?,?)', [
(1, 'astronomicaltransientcatalogue', b'first'),
(2, 'astronomicaltransientcatalogue', b'first'),
(3, 'astronomicaltransientcatalogues', b'first'),
(4, 'astronomicaltransientcatalogue', b'second'),
(5, 'astronomicaltransientcatalogue', None),
])
counts = global_identity._candidates(scratch, output)
records = [json.loads(row) for row in output.getvalue().splitlines()]
self.assertEqual(counts['exact_title_groups'], 1)
self.assertEqual(counts['exact_title_and_roster_papers'], 2)
self.assertEqual(counts['near_title_and_roster_pairs'], 2)
self.assertEqual(records[0]['paper_ids'], [1, 2])
self.assertEqual({tuple(r['paper_ids']) for r in records[1:]}, {(1, 3), (2, 3)})
def test_author_roster_limit_is_visible_in_receipt(self):
output = io.StringIO()
with sqlite3.connect(':memory:') as scratch:
scratch.execute('CREATE TABLE titles (id INTEGER, title_key TEXT, authors BLOB)')
scratch.executemany('INSERT INTO titles VALUES (?,?,?)', [
(1, 'astronomicaltransientcatalogue', b'first'),
(2, 'astronomicaltransientcatalogues', b'first'),
(3, 'astronomicaltransientcatalogued', b'first'),
])
with patch.object(global_identity, 'ROSTER_GROUP_LIMIT', 2):
counts = global_identity._candidates(scratch, output)
self.assertEqual(counts['oversized_rosters'], 1)
self.assertEqual(counts['papers_in_oversized_rosters'], 3)
self.assertEqual(counts['near_title_and_roster_pairs'], 0)
self.assertEqual(json.loads(output.getvalue())['kind'], 'oversized_roster')
def test_fingerprint_normalizes_supported_author_encodings(self):
strings = json.dumps(['Alice Doe', 'Chloë Li'])
records = json.dumps([['Li', 'Chloë'], {'given':'Alice','family':'Doe'}])
self.assertEqual(global_identity._author_fingerprint(strings),
global_identity._author_fingerprint(records))
self.assertIsNone(global_identity._author_fingerprint('[]'))
def test_doi_pattern_is_bound_as_a_parameter(self):
connection = Mock()
def execute(query, params):
self.assertEqual(query.count('?'), len(params))
if params:
pattern, = params
self.assertIn('https?', pattern)
result = Mock()
result.fetchone.return_value = (0,)
return result
connection.execute.side_effect = execute
self.assertEqual(global_identity._checks(connection)['normalized_doi_collisions'], 0)
+90
View File
@@ -0,0 +1,90 @@
from datetime import datetime, timezone
import json
import os
from pathlib import Path
import tempfile
import unittest
from unittest.mock import MagicMock
import urllib.error
from paper_atlas.io.html_cache import PublicHTMLCache, digest, NoRedirect
URL = 'https://eccv.ecva.net/virtual/2026/poster/4048'
class PublicHTMLCacheTests(unittest.TestCase):
def receipt(self, raw):
return {'url':URL,'final_url':URL,'http_status':200,'content_type':'text/html; charset=utf-8',
'bytes':len(raw),'sha256':digest(raw),'retrieved_at':datetime.now(timezone.utc).isoformat()}
def test_old_cache_reused_without_network_or_expiry(self):
with tempfile.TemporaryDirectory() as tmp:
c = PublicHTMLCache(tmp, 'https://eccv.ecva.net', delay=0); raw = b'<html>metadata</html>'
body, receipt, _ = c.paths(URL); body.write_bytes(raw); receipt.write_text(json.dumps(self.receipt(raw))); os.utime(body,(0,0))
c.opener = MagicMock(); self.assertEqual(c.get(URL)[0], raw); c.opener.open.assert_not_called()
def test_pair_tampering_and_orphan_parts_fail_without_refetch(self):
for kind in ('hash','orphan','part'):
with self.subTest(kind=kind), tempfile.TemporaryDirectory() as tmp:
c = PublicHTMLCache(tmp, 'https://eccv.ecva.net', delay=0); body, receipt, _ = c.paths(URL); body.write_bytes(b'original')
if kind == 'hash': receipt.write_text(json.dumps(self.receipt(b'different')))
if kind == 'part': body.unlink(); body.with_suffix('.html.part').write_bytes(b'partial')
c.opener = MagicMock()
with self.assertRaises(ValueError): c.get(URL)
c.opener.open.assert_not_called()
def test_http_access_failure_sticky_without_automatic_retry(self):
with tempfile.TemporaryDirectory() as tmp:
c = PublicHTMLCache(tmp, 'https://eccv.ecva.net', delay=0); c.opener = MagicMock()
c.opener.open.side_effect = urllib.error.HTTPError(URL,403,'Forbidden',{},None)
with self.assertRaises(urllib.error.HTTPError): c.get(URL)
with self.assertRaisesRegex(ValueError,'Previous access'): c.get(URL)
self.assertEqual(c.opener.open.call_count,1)
def test_redirect_nonhtml_challenge_and_oversize_rejected(self):
for kind in ('redirect','type','challenge','size'):
with self.subTest(kind=kind), tempfile.TemporaryDirectory() as tmp:
c = PublicHTMLCache(tmp,'https://eccv.ecva.net',limit=100,delay=0); c.opener=MagicMock(); r=c.opener.open.return_value.__enter__.return_value
r.status=200; r.geturl.return_value=URL; r.headers={'Content-Type':'text/html'}; r.read.return_value=b'<html>metadata</html>'
if kind=='redirect':r.geturl.return_value='https://example.org/login'
if kind=='type':r.headers={'Content-Type':'application/pdf'}
if kind=='challenge':r.read.return_value=b'<title>Just a moment</title>'
if kind=='size':r.read.return_value=b'x'*101
with self.assertRaises(ValueError):c.get(URL)
self.assertFalse(c.paths(URL)[0].exists())
self.assertIsNone(NoRedirect().redirect_request(None,None,None,None,None,None))
def test_valid_response_has_atomic_body_and_receipt(self):
with tempfile.TemporaryDirectory() as tmp:
c=PublicHTMLCache(tmp,'https://eccv.ecva.net',delay=0);c.opener=MagicMock();r=c.opener.open.return_value.__enter__.return_value;r.status=200;r.geturl.return_value=URL;r.headers={'Content-Type':'text/html','Content-Length':'4'};r.read.return_value=b'data'
raw, receipt=c.get(URL);self.assertEqual(raw,b'data');self.assertEqual(receipt['sha256'],digest(raw));self.assertEqual(c.cached(URL),(raw,receipt));self.assertFalse(list(Path(tmp).glob('*.part')))
def test_foreign_origin_and_cache_symlink_rejected(self):
with tempfile.TemporaryDirectory() as tmp:
c=PublicHTMLCache(tmp,'https://eccv.ecva.net',delay=0)
with self.assertRaises(ValueError):c.get('https://example.org/other')
body,_,_=c.paths(URL);target=Path(tmp)/'outside';target.write_bytes(b'other');body.symlink_to(target)
with self.assertRaises(ValueError):c.get(URL)
def test_successful_fetch_publishes_receipt_and_reuses_without_refetch(self):
with tempfile.TemporaryDirectory() as tmp:
c = PublicHTMLCache(tmp, 'https://eccv.ecva.net', delay=0)
c.opener = MagicMock(); response = c.opener.open.return_value.__enter__.return_value
response.status = 200; response.geturl.return_value = URL
raw = b'<html>public metadata</html>'
response.headers = {'Content-Type':'text/html','Content-Length':str(len(raw))}; response.read.return_value = raw
self.assertEqual(c.get(URL)[0], raw); self.assertEqual(c.get(URL)[0], raw)
self.assertEqual(c.opener.open.call_count, 1)
body, receipt, _ = c.paths(URL)
self.assertTrue(body.exists()); self.assertTrue(receipt.exists())
self.assertFalse(body.with_suffix('.html.part').exists())
self.assertFalse(receipt.with_suffix('.json.part').exists())
def test_changed_url_is_rejected_before_reading_body(self):
with tempfile.TemporaryDirectory() as tmp:
c = PublicHTMLCache(tmp, 'https://eccv.ecva.net', delay=0)
c.opener = MagicMock(); response = c.opener.open.return_value.__enter__.return_value
response.status = 200; response.geturl.return_value = 'https://example.org/login'
response.headers = {'Content-Type':'text/html'}
with self.assertRaises(ValueError): c.get(URL)
response.read.assert_not_called()
+95
View File
@@ -0,0 +1,95 @@
import gzip
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import icaps2026 as c
class ICAPS2026Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.bundle = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/icaps2026-source.json.gz').read_bytes()))
def snapshots(self, root):
root.mkdir()
for name, html in self.bundle['pages'].items():
(root/name).write_text(html)
(root/'manifest.json').write_text(json.dumps(self.bundle['manifest']))
return root
def test_full_listing_matches_independently_recorded_literals(self):
rows = c.parse_listing(self.bundle['pages']['accepted.html'])
self.assertEqual([{k: r[k] for k in ('section', 'title', 'authors_literal')} for r in rows],
[{k: r[k] for k in ('section', 'title', 'authors_literal')} for r in self.bundle['expected']])
self.assertEqual(sum(r['section'] == c.MAIN for r in rows), 90)
self.assertEqual(sum(r['section'] == c.PREVIOUS for r in rows), 10)
self.assertTrue(all(len(r['authors']) >= 2 for r in rows))
def test_incomplete_and_duplicate_listing_rejected(self):
html = self.bundle['pages']['accepted.html']
with self.assertRaises(ValueError):
c.parse_listing(html.replace('class=paper>', 'class=omitted>', 1))
with self.assertRaisesRegex(ValueError, 'repeated paper title'):
c.parse_listing(html.replace(self.bundle['expected'][1]['title'], self.bundle['expected'][0]['title']))
def test_changed_edition_or_section_rejected(self):
html = self.bundle['pages']['accepted.html']
for changed in [html.replace('ICAPS 2026</h1>', 'ICAPS 2027</h1>'),
html.replace(c.MAIN, 'Workshop Papers')]:
with self.assertRaises(ValueError):
c.parse_listing(changed)
def test_ambiguous_author_lists_not_guessed(self):
for literal in ['Anonymous', 'Alice, and Bob', 'Alice and Bob and Carol', 'Alice, Bob and name@example.org']:
with self.assertRaises(ValueError):
c.authors_from_literal(literal)
self.assertEqual(c.authors_from_literal('Augusto B. Corrêa, Simon Dold and Malte Helmert'),
['Augusto B. Corrêa', 'Simon Dold', 'Malte Helmert'])
def test_collection_separates_presentations_and_unresolved_tracks(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); src = self.snapshots(root/'src'); out = root/'out'
report = c.collect(out, snapshots=src)
self.assertEqual((report['records'], report['previously_published_presentations'], report['missing_abstract_count']), (90, 10, 90))
self.assertEqual(report['public_rejected_availability'], 'unknown')
rows = [json.loads(l) for l in Path(report['files'][0]['file']).read_text().splitlines()]
previous = json.loads((out/report['previously_published_file']).read_text())
self.assertFalse(previous['ingestion_ready']); self.assertEqual(previous['count'], 10)
self.assertFalse({r['title'] for r in rows} & {r['title'] for r in previous['records']})
self.assertTrue(all(r['track'] == 'main_tracks_unclassified' and r['status'] == 'accepted' for r in rows))
self.assertTrue(all(not r['identifiers'] and not r['submission_identifiers'] and r['abstract'] is None and not r['tags'] for r in rows))
self.assertEqual(len({r['external_id'] for r in rows}), 90)
self.assertTrue(all(r['metadata']['source_entry_key']['value'] in r['external_id'] for r in rows))
self.assertFalse(report['database_written']); self.assertFalse(report['pdfs_downloaded'])
self.assertEqual(report['files'][0]['status'], 'partial')
with self.assertRaisesRegex(ValueError, 'Output exists'):
c.collect(out, snapshots=src)
def test_tampering_retains_failure_without_success_receipt(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); src = self.snapshots(root/'src')
(src/'accepted.html').write_text('tampered')
with self.assertRaisesRegex(ValueError, 'hash changed'):
c.collect(root/'out', snapshots=src)
self.assertTrue((root/'out/failed.json').exists())
self.assertFalse((root/'out/collection-report.json').exists())
def test_receipt_redirect_naive_time_and_duplicate_source_rejected(self):
for kind in ('redirect', 'time', 'duplicate'):
with self.subTest(kind=kind), tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); src = self.snapshots(root/'src'); p = src/'manifest.json'; r = json.loads(p.read_bytes())
if kind == 'redirect': r['sources'][0]['final_url'] = 'https://example.org/challenge'
if kind == 'time': r['at'] = '2026-11-16T12:00:00'
if kind == 'duplicate': r['sources'][1] = r['sources'][0]
p.write_text(json.dumps(r))
with self.assertRaises(ValueError):
c.collect(root/'out', snapshots=src)
self.assertFalse((root/'out/collection-report.json').exists())
def test_snapshot_symlink_rejected(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); src = self.snapshots(root/'src'); p = src/'accepted.html'; raw = p.read_bytes(); p.unlink(); target = root/'external.html'; target.write_bytes(raw); p.symlink_to(target)
with self.assertRaisesRegex(ValueError, 'Unsafe'):
c.collect(root/'out', snapshots=src)
+96
View File
@@ -0,0 +1,96 @@
import copy
import gzip
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import icaps_registry2026 as c
class ICAPSRegistry2026Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.raw = gzip.decompress((Path(__file__).parent/'fixtures/icaps2026-crossref.json.gz').read_bytes())
cls.snapshot = json.loads(cls.raw)
def test_exact_edition_not_publication_year_alone(self):
papers, excluded = c.registry_papers(self.snapshot)
self.assertEqual(len(papers), 90); self.assertEqual(len(excluded), 1)
self.assertTrue(all(p['original']['volume'] == '36' for p in papers))
self.assertEqual(excluded, [r['DOI'] for r in self.snapshot['records'] if r['volume'] == '35'])
self.assertTrue(all(p['abstract'] and p['authors'] for p in papers))
def test_full_collection_keeps_registered_versions_and_publication_identity(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); src = root/'src'; src.mkdir(); (src/'crossref-filtered.json').write_bytes(self.raw)
report = c.collect(root/'out', snapshots=src)
self.assertEqual((report['records'], report['missing_abstract_count']), (90, 0))
self.assertFalse(report['database_written']); self.assertFalse(report['pdfs_downloaded'])
self.assertEqual(report['public_rejected_availability'], 'unknown')
manifest, = report['files']; self.assertEqual(manifest['status'], 'partial')
rows = [json.loads(l) for l in Path(manifest['file']).read_text().splitlines()]
original = {r['DOI']: r for r in self.snapshot['records'] if r['volume'] == '36'}
self.assertEqual({r['external_id'] for r in rows}, set(original))
for r in rows:
doi = r['external_id']; o = original[doi]
self.assertEqual(r['metadata']['registry_fields'], o)
self.assertEqual(r['title'], o['title'][0])
self.assertEqual(r['authors'], [a['given']+' '+a['family'] for a in o['authors']])
self.assertEqual(r['identifiers'], {'doi': doi})
self.assertEqual(r['submission_identifiers'], [{'scheme': 'publication_doi', 'value': doi}])
self.assertFalse(r['tags']); self.assertFalse(r['metadata']['original_decision_signature_verified'])
self.assertEqual(r['track'], 'main_tracks_unclassified')
self.assertEqual(r['metadata']['publication_date'], '2026-06-08')
changed = next(r for r in rows if r['external_id'] == '10.1609/icaps.v36i1.42860')
self.assertEqual(changed['title'], 'Analyzing Planner Design Trade-Offs for MAPF Under ADG-Based Realistic Execution')
self.assertIn('Stephen F. Smith', changed['authors'])
with self.assertRaisesRegex(ValueError, 'Output exists'):
c.collect(root/'out', snapshots=src)
def test_math_markup_is_not_flattened_as_plain_numbers(self):
self.assertEqual(c.abstract_text('<jats:p>A &lt; B and C &amp; D.\n Next line.</jats:p>'), 'A < B and C & D. Next line.')
for raw in ['<jats:p>10<sup>6</sup></jats:p>', '<jats:p>x</jats:p><jats:p>y</jats:p>', '<jats:p> </jats:p>', None]:
with self.assertRaises(ValueError):
c.abstract_text(raw)
def test_invalid_or_repeated_doi_and_edition_rejected(self):
for kind in ('doi', 'repeat', 'volume', 'container', 'year'):
with self.subTest(kind=kind):
s = copy.deepcopy(self.snapshot); rows = [r for r in s['records'] if r['volume'] == '36']; r = rows[0]
if kind == 'doi': r['DOI'] = '10.9999/foreign'
if kind == 'repeat': rows[1]['DOI'] = r['DOI']
if kind == 'volume': r['volume'] = '37'
if kind == 'container': r['container-title'] = ['Other Conference']
if kind == 'year': r['published']['date-parts'] = [[2025, 6, 8]]
with self.assertRaises(ValueError):
c.registry_papers(s)
def test_missing_authors_and_changed_order_evidence_rejected(self):
for kind in ('missing', 'sequence', 'profile'):
s = copy.deepcopy(self.snapshot); r = next(r for r in s['records'] if r['volume'] == '36')
if kind == 'missing': r['authors'][0].pop('family')
if kind == 'sequence': r['authors'][0]['sequence'] = 'additional'
if kind == 'profile': r['authors'][0]['ORCID'] = 'unreviewed-profile'
with self.assertRaises(ValueError):
c.registry_papers(s)
def test_receipt_scope_and_timezone_rejected(self):
for key, value in [('at', '2026-11-17T00:00:00'), ('url', 'https://example.org/works'), ('raw_response_sha256', 'other')]:
s = copy.deepcopy(self.snapshot); s[key] = value
with self.assertRaises(ValueError):
c.registry_papers(s)
def test_tamper_failure_retained_and_success_not_published(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); src = root/'src'; src.mkdir(); (src/'crossref-filtered.json').write_bytes(self.raw+b' ')
with self.assertRaisesRegex(ValueError, 'hash changed'):
c.collect(root/'out', snapshots=src)
self.assertTrue((root/'out/failed.json').exists())
self.assertFalse((root/'out/collection-report.json').exists())
def test_symlink_rejected(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); src = root/'src'; src.mkdir(); (root/'data.json').write_bytes(self.raw); (src/'crossref-filtered.json').symlink_to(root/'data.json')
with self.assertRaisesRegex(ValueError, 'Unsafe'):
c.collect(root/'out', snapshots=src)
+95
View File
@@ -0,0 +1,95 @@
import base64
import copy
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import icassp2026 as c
class ICASSP2026Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fixture = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/icassp2026-source.json.gz').read_bytes()))
cls.files = {name: base64.b64decode(body) for name, body in cls.fixture['files'].items()}
cls.items = []
cls.manifest = json.loads(cls.files[c.SNAPSHOT+'/manifest.json'])
for receipt in cls.manifest['pages']:
cls.items.extend((r, receipt) for r in json.loads(cls.files[c.SNAPSHOT+'/'+receipt['file']])['message']['items'])
def materialize(self, root):
for name, body in self.files.items():
path = root/name; path.parent.mkdir(parents=True, exist_ok=True); path.write_bytes(body)
def test_full_census_matches_independent_gold_and_preserves_source(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); src = root/'src'; self.materialize(src)
report = c.collect(root/'out', snapshots=src)
self.assertEqual((report['records'],report['missing_abstract_count'],report['single_name_author_fields']), (4582,4582,23))
self.assertEqual(len(report['excluded_nonpaper_items']),7); self.assertEqual(len(report['excluded_other_conference_dois']),56)
self.assertFalse(report['database_written']); self.assertFalse(report['pdfs_downloaded']); self.assertEqual(report['network_requests'],0)
self.assertEqual(report['approved_for_import'],0); self.assertEqual(report['public_rejected_availability'],'unknown')
manifest, = report['files']; path = Path(manifest['file']); raw = path.read_bytes()
self.assertEqual(hashlib.sha256(raw).hexdigest(),manifest['file_sha256']); self.assertEqual(manifest['status'],'partial')
rows = [json.loads(l) for l in raw.splitlines()]
actual = [{'doi':r['external_id'],'title':r['title'],'authors':r['authors']} for r in rows]
gold = sorted(self.fixture['independent_gold'],key=lambda r:r['doi'])
self.assertEqual(actual,gold)
original = {r['DOI']:r for r,_ in self.items}
evidence_hashes = {str(p.relative_to(root/'out')):hashlib.sha256(p.read_bytes()).hexdigest() for p in (root/'out/evidence').iterdir()}
for r in rows:
doi = r['external_id']; self.assertEqual(r['metadata']['registry_fields'],original[doi])
self.assertEqual(r['identifiers'],{'doi':doi}); self.assertEqual(r['submission_identifiers'],[{'scheme':'publication_doi','value':doi}])
self.assertEqual(r['track'],'proceedings_unclassified'); self.assertFalse(r['tags']); self.assertFalse(r['abstract'])
self.assertFalse(r['metadata']['original_decision_signature_verified'])
evidence = r['metadata']['source_evidence']
self.assertEqual(evidence_hashes[evidence['file']],evidence['sha256'])
self.assertIn('Fareedha',next(r for r in rows if r['external_id'].endswith('.11461474'))['authors'])
with self.assertRaisesRegex(ValueError,'Output exists'):
c.collect(root/'out',snapshots=src)
def test_wrong_conference_doi_date_and_unexpected_abstract_rejected(self):
for kind in ('container','event','doi','date','author','sequence','abstract'):
with self.subTest(kind=kind):
items = copy.deepcopy(self.items); r = next(r for r,_ in items if r.get('author') and r['DOI'].startswith(c.PREFIX))
if kind=='container': r['container-title']=['Foreign']
if kind=='event': r['event']['name']='Other'
if kind=='doi': r['DOI']='10.1109/foreign.2026.1'
if kind=='date': r['published']['date-parts']=[[2025,5,3]]
if kind=='author': r['author']=[]
if kind=='sequence': r['author'][0]['sequence']='additional'
if kind=='abstract': r['abstract']='new source version'
with self.assertRaises(ValueError): c.registry_papers(items)
def test_nonpaper_exclusion_requires_exact_reviewed_evidence(self):
for kind in ('title','page','author'):
items = copy.deepcopy(self.items); r = next(r for r,_ in items if r['DOI'] in c.NONPAPERS)
if kind=='title': r['title']=['A research paper']
if kind=='page': r['page']='1-5'
if kind=='author': r['author']=[{'family':'Smith'}]
with self.assertRaisesRegex(ValueError,'nonpaper'): c.registry_papers(items)
def test_duplicate_and_incomplete_census_rejected(self):
with self.assertRaisesRegex(ValueError,'repeated'): c.registry_papers(self.items+[self.items[0]])
with self.assertRaisesRegex(ValueError,'partition'): c.registry_papers(self.items[:-1])
def test_corruption_and_partial_input_preserve_failure_without_success(self):
for kind in ('manifest','body','missing'):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp); src=root/'src'; self.materialize(src)
path=src/c.SNAPSHOT/('manifest.json' if kind=='manifest' else 'page-002.json')
if kind=='missing': path.unlink()
else: path.write_bytes(path.read_bytes()+b' ')
with self.assertRaises((ValueError,FileNotFoundError)): c.collect(root/'out',snapshots=src)
self.assertTrue((root/'out/failed.json').exists()); self.assertFalse((root/'out/collection-report.json').exists())
def test_symlink_page_and_snapshot_rejected(self):
for kind in ('page','directory'):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp); src=root/'src'; self.materialize(src)
path=src/c.SNAPSHOT/('page-001.json' if kind=='page' else '')
renamed=path.with_name(path.name+'-original'); path.rename(renamed); path.symlink_to(renamed,target_is_directory=kind=='directory')
with self.assertRaisesRegex(ValueError,'Unsafe'): c.collect(root/'out',snapshots=src)
+113
View File
@@ -0,0 +1,113 @@
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import icdm2026 as c
class ICDM2026Tests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fixture = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/icdm2026-source.json.gz').read_bytes()))
cls.raw = cls.fixture['files'][c.SNAPSHOT+'/icdm-detailed-sessions.html'].encode()
cls.gold = cls.fixture['independent_inventory']
def snapshots(self, root):
for name, text in self.fixture['files'].items():
path = root/name; path.parent.mkdir(parents=True, exist_ok=True); path.write_bytes(text.encode())
def test_all_rows_match_separately_parsed_frozen_inventory(self):
result = c.parse_program(self.raw)
self.assertEqual(len(result), len(self.gold['entries']))
for position, (row, gold) in enumerate(zip(result, self.gold['entries']), 1):
for field in ('paper_id_literal', 'title', 'authors_literal', 'source_reported_authors', 'time_literal'):
self.assertEqual(row[field], gold[field])
self.assertEqual(row['source_position'], position)
for field, value in gold['session'].items():
self.assertEqual(row['session'][field], value)
def test_instantiable_collection_retains_scope_fields_and_source_bytes(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); self.snapshots(root/'src')
report = c.collect(root/'out', snapshots=root/'src')
self.assertEqual(report['track_counts'], self.gold['track_counts_literal'])
self.assertEqual(report['presentation_counts'], self.gold['presentation_counts_literal'])
self.assertEqual((report['records'], report['missing_abstract_count']), (324, 324))
self.assertFalse(report['database_written']); self.assertEqual(report['network_requests'], 0)
self.assertEqual(report['public_rejected_metadata'], 'unknown_no_public_export_verified')
all_rows = []
for manifest in report['files']:
path = Path(manifest['file']); raw = path.read_bytes()
self.assertEqual(hashlib.sha256(raw).hexdigest(), manifest['file_sha256'])
self.assertEqual(manifest['status'], 'partial')
rows = [json.loads(line) for line in raw.splitlines()]
self.assertEqual(len(rows), manifest['missing_abstract_count'])
for row in rows:
self.assertEqual((row['venue'], row['year'], row['track']), ('ICDM', 2026, manifest['track']))
self.assertIsNone(row['abstract']); self.assertIsNone(row['metadata']['paper_type'])
self.assertEqual(row['identifiers'], {}); self.assertEqual(row['submission_identifiers'], [])
self.assertFalse(row['metadata']['original_decision_signature_verified'])
self.assertEqual(row['external_id'], '2026/'+row['metadata']['program_fields']['paper_id_literal'])
self.assertTrue(row['url'].startswith(c.PROGRAM+'#paper-DM'))
self.assertTrue(all(t['namespace'].startswith(c.SOURCE+':') for t in row['tags']))
self.assertNotIn('doi', row['metadata']); self.assertNotIn('decision_date', row)
all_rows.extend(rows)
self.assertEqual(len({r['external_id'] for r in all_rows}), 324)
for item in report['evidence']:
raw = (root/'out'/item['output_file']).read_bytes()
self.assertEqual(raw, self.fixture['files'][c.SNAPSHOT+'/'+item['file']].encode())
self.assertTrue((root/'out/collection-report.json').is_file())
self.assertFalse((root/'out/collection-report.json.part').exists())
with self.assertRaisesRegex(ValueError, 'Output exists'):
c.collect(root/'out', snapshots=root/'src')
def test_stale_or_different_conference_rejected(self):
for old, new in [(b'IEEE ICDM 2026', b'IEEE ICDM 2025'),
(b'In-person session presentation list.', b'Workshop presentation list.')]:
with self.subTest(old=old), self.assertRaises(ValueError):
c.parse_program(self.raw.replace(old, new))
def test_track_attribute_must_agree_with_visible_label(self):
changed = self.raw.replace(b'data-track="research"', b'data-track="applied"', 1)
with self.assertRaisesRegex(ValueError, 'track'):
c.parse_program(changed)
def test_presentation_attribute_is_not_inferred_from_session_id(self):
changed = self.raw.replace(b'data-format="long"', b'data-format="short"', 1)
with self.assertRaisesRegex(ValueError, 'presentation'):
c.parse_program(changed)
def test_repeated_paper_and_source_locator_disagreement_rejected(self):
for old, new in [(b'DM1278', b'DM827'), (b'id="paper-DM827"', b'id="paper-DM99999"')]:
with self.subTest(old=old), self.assertRaises(ValueError):
c.parse_program(self.raw.replace(old, new))
def test_lost_session_or_changed_session_counts_rejected(self):
for old, new in [(b'data-session-id="L1"', b'data-session-id="L2"'),
(b'Long \xc2\xb7 7 papers', b'Long \xc2\xb7 6 papers')]:
with self.subTest(old=old), self.assertRaises(ValueError):
c.parse_program(self.raw.replace(old, new, 1))
def test_empty_author_is_not_silently_dropped(self):
changed = self.raw.replace(b'Qishuang Fu; Andreas Deppeler;', b'Qishuang Fu;;', 1)
with self.assertRaisesRegex(ValueError, 'author'):
c.parse_program(changed)
def test_snapshot_manifest_and_body_corruption_rejected_before_output(self):
for name in ('manifest.json', 'icdm-detailed-sessions.html', 'icdm-research-policy.html', 'icdm-applied-policy.html'):
with self.subTest(name=name), tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); self.snapshots(root/'src'); path = root/'src'/c.SNAPSHOT/name
path.write_bytes(path.read_bytes()+b' ')
with self.assertRaises(ValueError):
c.collect(root/'out', snapshots=root/'src')
self.assertFalse((root/'out').exists())
def test_snapshot_source_symlink_rejected(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); self.snapshots(root/'src'); path = root/'src'/c.SNAPSHOT/'icdm-detailed-sessions.html'
real = root/'real.html'; path.rename(real); path.symlink_to(real)
with self.assertRaisesRegex(ValueError, 'Unsafe source'):
c.collect(root/'out', snapshots=root/'src')
+92
View File
@@ -0,0 +1,92 @@
import base64
import copy
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import ismir2026 as c
class ISMIR2026Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fixture=json.loads(gzip.decompress((Path(__file__).parent/'fixtures/ismir2026-source.json.gz').read_bytes()))
cls.files={name:base64.b64decode(raw) for name,raw in cls.fixture['files'].items()}
cls.program=json.loads(cls.files['ismir2026-json-research-v1/papers.json'])
cls.accepted=cls.files['remaining2026-listings-research-v2/ismir-accepted.html']
def materialize(self,root):
for name,raw in self.files.items():
p=root/name;p.parent.mkdir(parents=True,exist_ok=True);p.write_bytes(raw)
def test140_source_versions_and_review_optins_against_independent_gold(self):
listing=c.accepted_listing(self.accepted);observations=c.program_observations(self.program,listing)
self.assertEqual(len(observations),140)
for observation,gold in zip(observations,self.fixture['independent_gold']):
r=observation['original'];v=r['content'];official=observation['accepted_listing']
self.assertEqual((r['id'],r['forum'],v['title'],v['authors'],v['abstract']),(gold['program_id'],gold['forum_literal'],gold['title'],gold['authors'],gold['abstract']))
self.assertEqual(official,{'title':gold['official_title'],'authors_literal':gold['official_authors_literal'],'author_names':gold['official_author_names']})
self.assertEqual(v['session'],gold['session_literal']);self.assertEqual(v['paper_presentation'],gold['presentation_literal']);self.assertEqual(v['keywords'],gold['keywords'])
self.assertEqual(sum('program_and_accepted_title_literal_versions_differ' in r['review_flags'] for r in observations),2)
self.assertEqual({r['original']['id'] for r in observations if 'program_and_accepted_author_sequence_versions_differ' in r['review_flags']},{'60','126','433'})
self.assertEqual(sum(r['original']['reviews']['publish_reviews']=='Yes' for r in observations),101)
def test_full_collection_keeps_abstract_bytes_review_text_tags_and_no_inferred_ids(self):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);src=root/'src';self.materialize(src);out=root/'out';report=c.collect(out,snapshots=src)
self.assertEqual((report['records'],report['missing_abstract_count'],report['review_optin_yes'],report['review_optin_no']),(140,0,101,39))
self.assertFalse(report['database_written']);self.assertFalse(report['pdfs_downloaded']);self.assertEqual(report['network_requests'],0);self.assertEqual(report['approved_for_import'],0)
self.assertEqual(report['public_rejected_availability'],'unknown_accepted_program_reviews_are_not_a_rejected_export')
manifest,=report['files'];raw=Path(manifest['file']).read_bytes();self.assertEqual(hashlib.sha256(raw).hexdigest(),manifest['file_sha256']);self.assertEqual(manifest['status'],'partial')
rows=[json.loads(l) for l in raw.splitlines()];self.assertEqual(len(rows),140)
for row,original,gold in zip(rows,self.program,self.fixture['independent_gold']):
self.assertEqual(row['metadata']['program_entry'],original);self.assertEqual(row['abstract'],gold['abstract']);self.assertEqual(row['title'],gold['title']);self.assertEqual(row['authors'],gold['authors'])
self.assertEqual(row['external_id'],'2026/'+gold['program_id']);self.assertEqual(row['identifiers'],{});self.assertEqual(row['submission_identifiers'],[])
self.assertEqual(row['status'],'accepted');self.assertEqual(row['track'],'program_unclassified');self.assertIsNone(row['metadata']['paper_type']);self.assertFalse(row['metadata']['original_decision_signature_verified'])
tags=[{'namespace':'ismir_program:presentation','value':gold['presentation_literal']}]+[{'namespace':'ismir_program:keyword','value':v} for v in dict.fromkeys(' '.join(k.split()) for k in gold['keywords'] if k.strip())]
self.assertEqual(row['tags'],tags);self.assertTrue(all(t['value'] for t in row['tags']))
if original['reviews']['publish_reviews']=='No':self.assertFalse(any(v for k,v in row['metadata']['program_entry']['reviews'].items() if k!='publish_reviews'))
for name,body in self.files.items():self.assertEqual((out/'evidence'/name).read_bytes(),body)
with self.assertRaisesRegex(ValueError,'Output exists'):c.collect(out,snapshots=src)
def test_duplicate_and_malformed_locator_or_incomplete_census_rejected(self):
listing=c.accepted_listing(self.accepted)
for kind in ('repeat','forum','non_numeric','missing_row'):
rows=copy.deepcopy(self.program)
if kind=='repeat':rows[1]['id']=rows[0]['id'];rows[1]['forum']=rows[0]['forum']
if kind=='forum':rows[0]['forum']='OriginalOpenReviewID'
if kind=='non_numeric':rows[0]['id']='abc';rows[0]['forum']='abc'
if kind=='missing_row':rows.pop()
with self.subTest(kind=kind),self.assertRaises(ValueError):c.program_observations(rows,listing)
def test_empty_fields_foreign_title_and_session_disagree_rejected(self):
listing=c.accepted_listing(self.accepted)
for field,value in [('authors',[]),('abstract',''),('title','A foreign paper'),('session',['99']),('keywords',[42])]:
rows=copy.deepcopy(self.program);rows[0]['content'][field]=value
with self.subTest(field=field),self.assertRaises(ValueError):c.program_observations(rows,listing)
def test_source_optin_no_cannot_publish_review_text(self):
rows=copy.deepcopy(self.program);r=next(r for r in rows if r['reviews']['publish_reviews']=='No');r['reviews']['meta_review']='Do not infer a negative decision'
with self.assertRaisesRegex(ValueError,'preference'):c.program_observations(rows,c.accepted_listing(self.accepted))
def test_parenthesized_affiliation_semicolons_do_not_split_people(self):
self.assertEqual(c.author_names('A Person (University A; Lab (X)); B Person (Institute B)'),['A Person','B Person'])
for raw in ['A Person (Broken','; A Person (Lab)','A Person )']:
with self.assertRaises(ValueError):c.author_names(raw)
def test_ambiguous_official_title_is_not_fused(self):
source=self.accepted.replace(b'FusID: Modality-Fused Semantic IDs for Generative Music Recommendation',b'Off-Manifold Robustness in Synthesizer Inversion with Joint Distribution Flow Matching',1)
with self.assertRaisesRegex(ValueError,'ambiguous'):c.accepted_listing(source)
def test_tamper_missing_file_and_symlink_fail_without_success_report(self):
for kind in ('manifest','body','missing','symlink'):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);src=root/'src';self.materialize(src);path=src/'ismir2026-json-research-v1'/('manifest.json' if kind=='manifest' else 'papers.json')
if kind=='missing':path.unlink()
elif kind=='symlink':other=root/'actual.json';path.rename(other);path.symlink_to(other)
else:path.write_bytes(path.read_bytes()+b' ')
with self.subTest(kind=kind),self.assertRaises((ValueError,FileNotFoundError)):c.collect(root/'out',snapshots=src)
self.assertTrue((root/'out/failed.json').exists());self.assertFalse((root/'out/collection-report.json').exists())
+68
View File
@@ -0,0 +1,68 @@
from hashlib import sha256
import json
from pathlib import Path
from tempfile import TemporaryDirectory
import unittest
from paper_atlas.cli import main
from paper_atlas.collectors.kdd2026 import inventory
def row(number, track, title='Paper title', authors='Name (Affiliation)'):
return {'track': track, 'title': title, 'url': f'https://doi.org/10.1145/3770855.{number}', 'authors': authors}
def snapshot(july, february):
arrays = [
f'<script>const cycle{n}Papers = {json.dumps(rows)}.map((paper, index) => paper);</script>'
for n, rows in ((1, july), (2, february))
]
return '\n'.join(arrays).encode()
class KDD2026Tests(unittest.TestCase):
def test_cli_preserves_withdrawal_marker_and_identical_occurrences(self):
retained = row(1, 'rtp')
withdrawn = row(2, 'ads', '**WITHDRAWN/New SUBMISSION ID for Authorship Order Change 6/24/26 -- A revised work')
incomplete = row(3, 'ais', authors='')
raw = snapshot([retained, retained], [withdrawn, incomplete])
with TemporaryDirectory() as directory:
source = Path(directory) / 'snapshot.html'
source.write_bytes(raw)
out = source.with_suffix('.json')
args = ['collect', 'kdd2026-program', '--snapshot', str(source), '--snapshot-sha256',
sha256(raw).hexdigest(), '--out', str(out)]
main(args)
report = json.loads(out.read_bytes())
with self.assertRaises(FileExistsError):
main(args)
self.assertEqual(report['source_rows_by_cycle_and_track'], {
'july': {'research': 2}, 'february': {'applied_data_science': 1, 'ai_for_sciences': 1},
})
self.assertEqual(report['unique_dois'], 3)
self.assertEqual(report['identical_repeat_rows'], 1)
kept, replaced, sparse = report['records']
self.assertEqual(kept['occurrences'], 2)
self.assertEqual(replaced['programme_status'], 'withdrawn_with_replacement_mentioned')
self.assertEqual(replaced['title'], 'A revised work')
self.assertEqual(replaced['source_title'], withdrawn['title'])
self.assertEqual(replaced['source_withdrawal_date_literal'], '6/24/26')
self.assertNotIn('submission_id', replaced)
self.assertFalse(sparse['authors_listed'])
self.assertFalse(report['database_written'])
def test_conflicting_duplicate_and_unknown_status_fail(self):
with self.assertRaisesRegex(ValueError, 'Conflicting duplicate DOI'):
inventory(snapshot([row(1, 'rtp')], [row(1, 'ads')]))
with self.assertRaisesRegex(ValueError, 'Unrecognized status'):
inventory(snapshot([row(1, 'rtp')], [row(2, 'ads', '***WITHDRAWN -- Unknown format')]))
def test_hash_mismatch_leaves_no_output(self):
with TemporaryDirectory() as directory:
source = Path(directory) / 'snapshot.html'
source.write_bytes(snapshot([row(1, 'rtp')], [row(2, 'ads')]))
out = source.with_suffix('.json')
with self.assertRaisesRegex(ValueError, 'snapshot hash or size'):
main(['collect', 'kdd2026-program', '--snapshot', str(source), '--snapshot-sha256',
'0' * 64, '--out', str(out)])
self.assertFalse(out.exists())
+146
View File
@@ -0,0 +1,146 @@
import copy
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import mm2026 as c
class MM2026Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fixture = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/mm2026-source.json.gz').read_bytes()))
cls.files = {name:body.encode('utf-8') for name,body in cls.fixture['files'].items()}
cls.raw = cls.files[c.SNAPSHOT+'/program-data.json']
cls.data = json.loads(cls.raw)
cls.gold = cls.fixture['independent_inventory']
def materialize(self, root):
for name,body in self.files.items():
path = root/name; path.parent.mkdir(parents=True,exist_ok=True); path.write_bytes(body)
def parse_changed(self, data):
return c.parse_program(json.dumps(data,ensure_ascii=False).encode())
def test_all2143_ids_and4326_locations_against_independent_inventory(self):
rows,sessions = c.parse_program(self.raw)
self.assertEqual(len(rows),2143); self.assertEqual(len(sessions),157)
self.assertEqual(sum(len(r['contexts']) for r in rows),4326)
actual = {r['paper_id']:r for r in rows}
self.assertEqual(set(actual),{g['paper_id'] for g in self.gold['inventory']})
for gold in self.gold['inventory']:
r = actual[gold['paper_id']]
self.assertEqual((r['title'],r['authors'],r['track'],r['affiliations']),
(gold['title'],gold['authors'],gold['track_literal'],gold['affiliations']))
self.assertEqual(hashlib.sha256(r['abstract'].encode()).hexdigest(),gold['abstract_sha256'])
self.assertEqual([x['source_pointer'] for x in r['contexts']],gold['locations'])
def test_every_presentation_and_session_context_is_preserved(self):
rows,sessions = c.parse_program(self.raw)
for r in rows:
for context in r['contexts']:
node = self.data
for key in context['source_pointer'].split('/')[1:]:
node = node[int(key)] if isinstance(node,list) else node[key]
self.assertEqual(context['presentation'],{k:node[k] for k in c.PRESENTATION if k in node})
self.assertEqual(r['paper_id'],node['paper_id'])
for i,session in enumerate(sessions):
original = self.data['entries'][i]
self.assertEqual(session['source_pointer'],'/entries/'+str(i))
self.assertEqual(session['track'],'')
for key in original.keys()-{'papers','subsessions'}:
self.assertEqual(session[key],original[key])
for j,sub in enumerate(original.get('subsessions') or []):
saved = session['subsessions'][j]
self.assertEqual(saved['title'],sub['title'])
expected = [x for x in sub.get('items') or [] if 'paper_id' not in x]
self.assertEqual([x['fields'] for x in saved['nonpaper_items']],expected)
def test_all_tracks_retained_without_publication_or_negative_inference(self):
rows,_ = c.parse_program(self.raw)
self.assertEqual({r['track'] for r in rows},set(self.gold['unique_id_track_counts']))
for r in rows:
self.assertFalse(r['approved_for_import']); self.assertFalse(r['final_decision_verified'])
self.assertFalse(r['publication_identity_verified'])
self.assertEqual(r['source_locator'],{'namespace':'mm_program:program_id','value':r['paper_id']})
self.assertEqual(r['tags'],[{'namespace':'mm_program:track','value':r['track']}])
self.assertEqual(r['observed_status'],'listed_in_official_program')
self.assertTrue({'status','identifiers','submission_identifiers','paper_type','emails'}.isdisjoint(r))
missing = [r for r in rows if not r['authors']]
self.assertEqual({r['paper_id'] for r in missing},{'mfp4971','mfp7801'})
self.assertTrue(all(r['missing_fields']==['authors','abstract'] for r in missing))
self.assertEqual(sum(not r['abstract'] for r in rows),216)
def test_collect_evidence_hashes_and_no_contact_arrays_in_normalized_output(self):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);self.materialize(root/'src')
report=c.collect(root/'out',snapshots=root/'src')
self.assertEqual((report['records'],report['program_observations'],report['extra_presentation_observations']),(2143,4326,2183))
self.assertFalse(report['database_written']);self.assertFalse(report['pdfs_downloaded'])
self.assertEqual(report['network_requests'],0);self.assertEqual(report['approved_for_import'],0)
self.assertEqual(report['public_negative_access']['http_statuses'],[403]*4)
self.assertEqual(report['track_counts'],self.gold['unique_id_track_counts'])
for name,body in self.files.items():
self.assertEqual((root/'out/evidence'/Path(name).name).read_bytes(),body)
n=0
for item in report['files']:
raw=Path(item['file']).read_bytes();self.assertEqual(hashlib.sha256(raw).hexdigest(),item['file_sha256'])
self.assertNotIn(b'"emails"',raw);self.assertEqual(len(raw.splitlines()),item['count']);n+=item['count']
self.assertEqual(item['format'],'mm_program_observation_v1_not_ingestion_record')
self.assertEqual(n,2143)
raw=(root/'out/sessions.jsonl').read_bytes()
self.assertEqual(hashlib.sha256(raw).hexdigest(),report['sessions_file_sha256']);self.assertNotIn(b'"emails"',raw)
with self.assertRaisesRegex(ValueError,'Output exists'):c.collect(root/'out',snapshots=root/'src')
def test_conflicting_core_version_is_not_silently_merged(self):
data=copy.deepcopy(self.data)
first=data['entries'][0]['papers'][0]
data['entries'][0]['papers'].append({**first,'abstract':'conflicting abstract'})
with self.assertRaisesRegex(ValueError,'Conflicting core'):self.parse_changed(data)
def test_unknown_nesting_cannot_silently_lose_observations(self):
data=copy.deepcopy(self.data)
moved=data['entries'][0]['papers'].pop()
data['entries'][0]['unreviewed_bucket']=[moved]
with self.assertRaisesRegex(ValueError,'Unhandled'):self.parse_changed(data)
def test_track_drift_unknown_fields_or_missing_title_require_review(self):
for kind in ('outer_track','paper_track','field','title','authors'):
data=copy.deepcopy(self.data);paper=data['entries'][0]['papers'][0]
if kind=='outer_track':data['entries'][0]['track']='Main Track'
elif kind=='paper_track':paper['track']='New Track'
elif kind=='field':paper['doi']='unreviewed'
elif kind=='title':paper['title']=''
else:paper['authors']='Unparsed author string'
with self.subTest(kind=kind),self.assertRaises(ValueError):self.parse_changed(data)
def test_edition_or_census_change_requires_review(self):
for kind in ('edition','count'):
data=copy.deepcopy(self.data)
if kind=='edition':data['generated_at']='2025-11-14T18:36:26.860677+00:00'
else:data['entries'][0]['papers'].pop()
with self.subTest(kind=kind),self.assertRaises(ValueError):self.parse_changed(data)
def test_corruption_missing_evidence_and_symlink_fail_without_completed_report(self):
for kind in ('manifest','program','probe','missing','symlink'):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);self.materialize(root/'src');directory=root/'src'/c.SNAPSHOT
name='manifest.json' if kind=='manifest' else 'openreview-rejected-probe.json' if kind=='probe' else 'program-data.json'
path=directory/name
if kind=='missing':path.unlink()
elif kind=='symlink':
original=directory/'original.json';path.rename(original);path.symlink_to(original)
else:path.write_bytes(path.read_bytes()+b' ')
with self.subTest(kind=kind),self.assertRaises((ValueError,FileNotFoundError)):c.collect(root/'out',snapshots=root/'src')
self.assertTrue((root/'out/failed.json').exists());self.assertFalse((root/'out/collection-report.json').exists())
def test_literal_abstract_math_and_nonpaper_session_events_retained(self):
rows,sessions=c.parse_program(self.raw)
self.assertTrue(any('\\' in r['abstract'] for r in rows))
self.assertTrue(any('\n' in r['abstract'] for r in rows))
self.assertTrue(any(s['type']=='coffee_break' for s in sessions))
self.assertTrue(any(s['type']=='industry_talk' for s in sessions))
self.assertEqual(c.without_emails({'emails':['contact'],'items':[{'emails':['contact'],'title':'talk'}]}),{'items':[{'title':'talk'}]})
+273
View File
@@ -0,0 +1,273 @@
from contextlib import redirect_stdout
import io
import os
import uuid
import gzip
import hashlib
import json
from pathlib import Path
import re
import tempfile
import unittest
from paper_atlas.collectors import mm_publications2026 as c
class MMPublications2026Tests(unittest.TestCase):
@classmethod
def setUpClass(cls):
fixtures=Path(__file__).parent/'fixtures'
cls.fixture=json.loads(gzip.decompress((fixtures/'mm2026-publications.json.gz').read_bytes()))
cls.program_fixture=json.loads(gzip.decompress((fixtures/'mm2026-source.json.gz').read_bytes()))
cls.format_gold=json.loads((fixtures/'mm2026-title-formatting-review.json').read_text())
overrides={g['doi']:g for g in [*cls.format_gold['gold'],cls.format_gold['held_gold']]}
cls.gold=[overrides.get(g['doi'],g) for g in cls.fixture['independent_gold']]
cls.temp=tempfile.TemporaryDirectory();cls.root=Path(cls.temp.name)
cls.materialize(cls.root/'registry',cls.fixture['files'])
cls.materialize(cls.root/'program',cls.program_fixture['files'])
cls.out=cls.root/'out'
cls.report=c.collect(cls.out,registry_snapshots=cls.root/'registry',program_snapshots=cls.root/'program',parent_snapshot=cls.root/'registry/parent.json')
cls.rows=[json.loads(line) for f in cls.report['files'] for line in Path(f['file']).read_bytes().splitlines()]
cls.by_doi={r['external_id']:r for r in cls.rows}
@classmethod
def tearDownClass(cls):
cls.temp.cleanup()
@staticmethod
def materialize(root,files):
for name,body in files.items():
path=root/name;path.parent.mkdir(parents=True,exist_ok=True);path.write_bytes(body.encode('utf-8'))
def test_all1918_publications_against_independent_registry_program_gold(self):
self.assertEqual(len(self.rows),1918);self.assertEqual(len(self.by_doi),1918)
self.assertEqual(set(self.by_doi),{g['doi'] for g in self.gold})
for g in self.gold:
r=self.by_doi[g['doi']];m=r['metadata'];p=m['program_fields']
self.assertEqual((r['title'],r['authors'],r['track']),(g['title'],g['authors'],g['track']))
self.assertEqual(m['program_match_kind'],g['kind'])
self.assertEqual(m['registry_source_evidence']['json_pointer'],'/message/items/'+str(g['source_position']))
self.assertEqual(m['registry_source_evidence']['file'],'evidence/registry/'+g['source_page'])
self.assertEqual(m['registry_source_evidence']['canonical_object_json_sha256'],g['registry_object_sha256'])
self.assertEqual(p['paper_id'] if p else None,g['program_id'])
self.assertEqual([x['source_pointer'] for x in p['contexts']] if p else [],g['program_context_pointers'])
def test_abstract_source_is_separate_and_verbatim_not_fabricated_registry_abstract(self):
count=0
for g in self.gold:
r=self.by_doi[g['doi']];m=r['metadata']
self.assertFalse(m['registry_abstract_available']);self.assertFalse(m['registry_fields'].get('abstract'))
if g['abstract_sha256'] is not None:
count+=1;self.assertEqual(hashlib.sha256(r['abstract'].encode()).hexdigest(),g['abstract_sha256'])
self.assertEqual(r['abstract'],m['program_fields']['abstract'])
self.assertEqual(m['abstract_source'],'official_program_reviewed_title_formatting_correspondence' if g['kind'].startswith('unique_program_format_') else 'official_program_exact_metadata_correspondence')
else:
self.assertIsNone(r['abstract']);self.assertEqual(m['abstract_source'],'not_available_from_reviewed_sources')
self.assertEqual(count,1743);self.assertEqual(self.report['output_missing_abstract_count'],175)
def test_all_program_tracks_and_4326_contexts_survive_in_matches_or_unmatched(self):
programs={r['metadata']['program_fields']['paper_id']:r['metadata']['program_fields'] for r in self.rows if r['metadata']['program_fields']}
for p in self.report['unmatched_program']:
self.assertNotIn(p['paper_id'],programs);programs[p['paper_id']]=p
self.assertEqual(len(programs),2143);self.assertEqual(self.report['unmatched_program_count'],391)
gold=self.program_fixture['independent_inventory']['inventory']
self.assertEqual(set(programs),{g['paper_id'] for g in gold})
for g in gold:
p=programs[g['paper_id']]
self.assertEqual((p['title'],p['authors'],p['track']),(g['title'],g['authors'],g['track_literal']))
self.assertEqual([x['source_pointer'] for x in p['contexts']],g['locations'])
self.assertEqual(sum(len(p['contexts']) for p in programs.values()),4326)
self.assertEqual(len({p['track'] for p in programs.values()}),28)
def test_no_person_alias_original_submission_decision_or_research_type_inference(self):
for r in self.rows:
doi=r['external_id'];m=r['metadata']
self.assertEqual(r['identifiers'],{'doi':doi})
self.assertEqual(r['submission_identifiers'],[{'scheme':'publication_doi','value':doi}])
self.assertEqual((r['source'],r['venue'],r['year']),(c.SOURCE,'MM',2026))
self.assertEqual(r['status'],'accepted');self.assertIn('not an original signed decision',r['raw_decision'])
self.assertFalse(m['original_decision_signature_verified']);self.assertFalse(m['research_type_classified'])
self.assertFalse(m['scientific_work_identity_approved'])
self.assertTrue({'decided_at','decision_date','source_decision_id','paper_type'}.isdisjoint(r))
self.assertIn({'namespace':c.SOURCE+':crossref:type','value':'proceedings-article'},r['tags'])
self.assertTrue({x['namespace'] for x in r['tags']} <= {c.SOURCE+':crossref:type',c.SOURCE+':mm_program:track'})
for track in ('interactive_art','industry_talk','demo_and_video'):
self.assertTrue(any(r['track']==track for r in self.rows))
variants=[r for r in self.rows if r['track']=='proceedings_unclassified']
self.assertEqual(len(variants),166)
self.assertTrue(all(r['metadata']['program_fields'] is None and r['abstract'] is None for r in variants))
def test_original_bibliography_evidence_kept_without_duplicating_reference_payload(self):
authors_by_page={}
for name,body in self.fixture['files'].items():
actual=self.out/'evidence/registry'/('parent.json' if name=='parent.json' else Path(name).name)
self.assertEqual(actual.read_bytes(),body.encode())
if re.fullmatch(r'page-[0-9]+\.json',Path(name).name):
authors_by_page[str(actual.relative_to(self.out))]=[row['author'] for row in json.loads(body)['message']['items']]
for name,body in self.program_fixture['files'].items():
self.assertEqual((self.out/'evidence/program'/Path(name).name).read_bytes(),body.encode())
for r in self.rows:
m=r['metadata'];self.assertNotIn('reference',m['registry_fields'])
self.assertEqual(m['registry_fields']['title'],[r['title']])
self.assertEqual(m['registry_fields']['author'],authors_by_page[m['registry_source_evidence']['file']][int(m['registry_source_evidence']['json_pointer'].rsplit('/',1)[-1])])
for f in self.report['files']:
raw=Path(f['file']).read_bytes();self.assertEqual(hashlib.sha256(raw).hexdigest(),f['file_sha256'])
self.assertEqual(len(raw.splitlines()),f['count']);self.assertEqual(f['status'],'partial')
def test_eight_single_name_fields_preserved_without_splitting(self):
n=0
for g in self.gold:
r=self.by_doi[g['doi']];flags=r['metadata']['review_flags']
actual=[x['author_position'] for x in flags if x['kind']=='single_registered_name_field_not_split']
self.assertEqual(actual,g['single_name_positions']);n+=len(actual)
for i in actual:
self.assertEqual(r['authors'][i-1],r['metadata']['registry_fields']['author'][i-1]['family'].strip())
self.assertEqual(n,8)
def test_structured_title_markup_retained_and_flagged_without_flattening(self):
count=0
for g in self.gold:
if re.search(r'<[^>]+>|&[A-Za-z#0-9]+;',g['title']):
count+=1;r=self.by_doi[g['doi']]
self.assertEqual(r['title'],g['title'])
self.assertIn({'kind':'literal_title_markup_or_entity_retained_requires_review'},r['metadata']['review_flags'])
self.assertGreater(count,0);self.assertEqual(count,self.report['registered_title_markup_flags'])
def test_formatting_gold_preserves_raw_fields_and_copies_exact_program_evidence(self):
self.assertEqual(len(self.format_gold['gold']),26)
for gold in self.format_gold['gold']:
row=self.by_doi[gold['doi']];m=row['metadata'];p=m['program_fields']
self.assertEqual((row['title'],row['authors']),(gold['title'],gold['authors']))
self.assertEqual((p['paper_id'],row['track']),(gold['program_id'],gold['track']))
self.assertEqual(hashlib.sha256(row['abstract'].encode()).hexdigest(),gold['abstract_sha256'])
comparison=m['program_title_formatting_comparison']
self.assertTrue(comparison['raw_titles_preserved']);self.assertFalse(comparison['work_identity_approved'])
self.assertEqual(set(comparison['program_comparison_texts']),{p['paper_id']})
self.assertFalse(m['scientific_work_identity_approved'])
held=self.by_doi[self.format_gold['author_disagreement_hold']['doi']]
self.assertEqual(held['metadata']['program_title_candidates'],['mfp7801'])
self.assertEqual(held['metadata']['program_exact_candidates'],[])
self.assertEqual(held['metadata']['program_match_kind'],'program_format_author_version_requires_review')
self.assertIsNone(held['abstract']);self.assertEqual(held['track'],'proceedings_unclassified')
def test_reviewed_formatting_keeps_superscript_subscript_and_decodes_entities_once(self):
self.assertEqual(c.formatting_text('<i>A</i> H<sup>2</sup> B<sub>1</sub> &amp; C'),'A H2 B1 & C')
self.assertEqual(c.formatting_text('A &amp;amp; B'),'A &amp; B')
def test_unknown_attributes_unbalanced_or_encoded_markup_not_discarded(self):
for title in ['A <model>B</model>','A <i class="x">B</i>','A <i>B','A </i>B',
'A <sup/>B','A <!--hidden-->B','<!DOCTYPE html>A','A &lt;i&gt;B&lt;/i&gt;',
'A <sup','A <i>B</sup>','<![CDATA[A]]>']:
with self.subTest(title=title):self.assertIsNone(c.formatting_text(title))
def test_ambiguous_program_and_author_multiset_differences_remain_held(self):
def observation(pid,authors):
return {'paper_id':pid,'title':'M3 Model','authors':authors,'track':'Main Track'}
rows=[{'title':'M<sup>3</sup> Model','authors':['A','B']}]
kinds,_=c.match_program(rows,[observation('p1',['A','B']),observation('p2',['B','A'])])
self.assertEqual(kinds,{'multiple_program_ids_same_title_authors_hold':1})
self.assertNotIn('program',rows[0])
rows=[{'title':'M<sup>3</sup> Model','authors':['A','A','B']}]
c.match_program(rows,[observation('p1',['A','B'])])
self.assertEqual(rows[0]['kind'],'program_format_author_version_requires_review')
self.assertNotIn('program',rows[0])
def test_literal_title_author_disagreement_does_not_use_formatting_bypass(self):
rows=[{'title':'M<sup>3</sup> Model','authors':['A','B']}]
observations=[{'paper_id':'literal','title':'M<sup>3</sup> Model','authors':['Other'],'track':'Main Track'},
{'paper_id':'formatted','title':'M3 Model','authors':['A','B'],'track':'Main Track'}]
c.match_program(rows,observations)
self.assertEqual(rows[0]['kind'],'program_author_version_requires_review')
self.assertEqual(rows[0]['program_title_candidates'],['literal']);self.assertNotIn('program',rows[0])
def test_corrupt_registry_parent_or_program_keeps_failure_not_complete_output(self):
for kind in ('registry_manifest','registry_page','parent','program'):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);self.materialize(root/'registry',self.fixture['files']);self.materialize(root/'program',self.program_fixture['files'])
path={'registry_manifest':root/'registry'/c.SNAPSHOT/'manifest.json','registry_page':root/'registry'/c.SNAPSHOT/'page-001.json','parent':root/'registry/parent.json','program':root/'program'/c.program.SNAPSHOT/'program-data.json'}[kind]
path.write_bytes(path.read_bytes()+b' ')
with self.subTest(kind=kind),self.assertRaises(ValueError):
c.collect(root/'out',registry_snapshots=root/'registry',program_snapshots=root/'program',parent_snapshot=root/'registry/parent.json')
self.assertTrue((root/'out/failed.json').exists());self.assertFalse((root/'out/collection-report.json').exists())
def test_symlink_source_rejected_and_no_previous_output_overwrite(self):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);self.materialize(root/'registry',self.fixture['files'])
path=root/'registry/parent.json';original=root/'registry/actual.json';path.rename(original);path.symlink_to(original)
with self.assertRaisesRegex(ValueError,'Unsafe'):
c.collect(root/'out',registry_snapshots=root/'registry',program_snapshots=self.root/'program',parent_snapshot=path)
with self.assertRaisesRegex(ValueError,'Output exists'):
c.collect(self.out,registry_snapshots=self.root/'registry',program_snapshots=self.root/'program',parent_snapshot=self.root/'registry/parent.json')
def test_complete_report_retains_source_partitions_not_import_or_final_dedup_claim(self):
self.assertEqual(self.report['program_match_counts'],{'unique_program_title_fullauthor_agreement_not_identity_approval':1726,'unique_program_format_title_fullauthor_agreement_not_identity_approval':26,'program_author_version_requires_review':122,'program_format_author_version_requires_review':1,'no_exact_program_title_requires_review':43})
self.assertEqual(self.report['registry_missing_abstract_count'],1918)
self.assertEqual(self.report['abstracts_from_exact_program_correspondence'],1743)
self.assertEqual(self.report['abstracts_from_literal_program_correspondence'],1717)
self.assertEqual(self.report['abstracts_from_reviewed_title_formatting'],26)
self.assertEqual(self.report['unmatched_program_count'],391)
self.assertEqual(sum(f['count'] for f in self.report['files']),1918)
self.assertEqual(self.report['approved_for_import'],0);self.assertFalse(self.report['database_written'])
self.assertFalse(self.report['pdfs_downloaded']);self.assertEqual(self.report['network_requests'],0)
self.assertIn('unknown',self.report['public_negative_availability'])
def assert_native_ingestion(self, pg_service=None):
# An isolated synthetic database exercises the writer contract, not a
# production identity approval. All source rows/track partitions run.
from paper_atlas.db.store import Store
from paper_atlas.db.backend import open_store
from paper_atlas.ingestion.records import ingest_file
from paper_atlas.postgres.client import connect
from paper_atlas.postgres.migration import migrate
from paper_atlas.postgres.schema import quote
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);db=root/'seed.sqlite';seed=self.rows[0]
store=Store(db)
paper,record=store.record('arxiv','synthetic-mm-anchor','https://example.org/arxiv',
seed['title'],'Existing canonical abstract',seed['authors'],seed['identifiers'])
store.decision(paper,record,'ICLR',2025,'main','synthetic-old-forum',
'https://example.org/decision','rejected','Reject')
before=tuple(store.conn.execute('SELECT * FROM papers WHERE id=?',(paper,)).fetchone())
store.conn.commit();store.conn.close()
schema='pa_mm_pub_'+uuid.uuid4().hex[:12] if pg_service else None
try:
with redirect_stdout(io.StringIO()):
if pg_service:migrate(db,pg_service,root/'migration.json',schema=schema,min_free_gib=0)
for f in self.report['files']:
ingest_file(None if pg_service else db,f['file'],pg_service=pg_service,pg_schema=schema)
store=open_store(None if pg_service else db,pg_service=pg_service,pg_schema=schema)
try:
conn=store.conn
self.assertEqual(tuple(conn.execute('SELECT * FROM papers WHERE id=?',(paper,)).fetchone()),before)
self.assertEqual(conn.execute('SELECT status FROM decisions WHERE submission_id=1').fetchone()[0],'rejected')
actual={r[0]:r for r in conn.execute("SELECT sr.external_id,sr.paper_id,sr.title,sr.abstract,sr.authors_json,sr.metadata_json,sr.id FROM source_records sr JOIN sources s ON s.id=sr.source_id WHERE s.name=?",(c.SOURCE,))}
self.assertEqual(set(actual),set(self.by_doi))
self.assertEqual(actual[seed['external_id']][1],paper)
for doi,row in self.by_doi.items():
got=actual[doi];self.assertEqual((got[2],got[3],json.loads(got[4])),(row['title'],row['abstract'],row['authors']))
meta=json.loads(got[5]);self.assertEqual(meta.pop('record_identifiers'),{'doi':doi,c.SOURCE:doi});self.assertEqual(meta,row['metadata'])
tags=conn.execute("SELECT t.namespace,t.value,count(*) FROM paper_tags pt JOIN tags t ON t.id=pt.tag_id GROUP BY t.namespace,t.value").fetchall()
self.assertEqual(sum(r[2] for r in tags if r[0]==c.SOURCE+':crossref:type'),1918)
self.assertEqual(sum(r[2] for r in tags if r[0]==c.SOURCE+':mm_program:track'),1752)
self.assertEqual({r[0] for r in tags},{c.SOURCE+':crossref:type',c.SOURCE+':mm_program:track'})
decisions=conn.execute("SELECT d.status,d.decision_date,count(*) FROM decisions d JOIN submissions s ON s.id=d.submission_id JOIN source_records r ON r.id=s.source_record_id JOIN sources src ON src.id=r.source_id WHERE src.name=? GROUP BY d.status,d.decision_date",(c.SOURCE,)).fetchall()
self.assertEqual([tuple(r) for r in decisions],[('accepted',None,1918)])
self.assertEqual(conn.execute("SELECT count(*) FROM submission_identifiers WHERE scheme='publication_doi'").fetchone()[0],1918)
coverage=conn.execute("SELECT es.status,sum(es.imported_count) FROM edition_sources es JOIN sources s ON s.id=es.source_id WHERE s.name=? GROUP BY es.status",(c.SOURCE,)).fetchall()
self.assertEqual([tuple(r) for r in coverage],[('partial',1918)])
finally:store.conn.close()
finally:
if pg_service:
with connect(pg_service) as pg:
for name, in pg.execute('SELECT nspname FROM pg_namespace WHERE starts_with(nspname,%s)',(schema,)).fetchall():
pg.execute('DROP SCHEMA '+quote(name)+' CASCADE')
def test_all1918_native_sqlite_source_tags_and_prior_rejection_survive(self):
self.assert_native_ingestion()
@unittest.skipUnless(os.environ.get('PAPER_ATLAS_TEST_PG_SERVICE'),'Requires approved remote PostgreSQL test service')
def test_all1918_native_postgres_source_tags_and_prior_rejection_survive(self):
self.assert_native_ingestion(os.environ['PAPER_ATLAS_TEST_PG_SERVICE'])
+101
View File
@@ -0,0 +1,101 @@
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
from paper_atlas.collectors import mm2026
from paper_atlas.audits.source_identity import audit, load_inputs, load_mm_program_inputs
class MMProgramIdentityInputTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fixture = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/mm2026-source.json.gz').read_bytes()))
def setUp(self):
self.tmp = tempfile.TemporaryDirectory()
self.addCleanup(self.tmp.cleanup)
self.root = Path(self.tmp.name)
src = self.root/'source'
for name,body in self.fixture['files'].items():
path=src/name;path.parent.mkdir(parents=True,exist_ok=True);path.write_bytes(body.encode())
mm2026.collect(self.root/'program', snapshots=src)
self.report_path = self.root/'program/collection-report.json'
def change_report(self, change):
report=json.loads(self.report_path.read_text());change(report)
self.report_path.write_text(json.dumps(report))
def assert_rejected_before_database(self):
with patch('paper_atlas.audits.source_identity.ReadConnection') as connection:
with self.assertRaises(ValueError):
audit(None,self.root/'audit',pg_service='unused',pg_schema='research',mm_program_report=self.report_path)
connection.assert_not_called()
self.assertFalse((self.root/'audit').exists())
def test_all2143_programs_are_unknown_readonly_inputs_not_import_records(self):
rows,inputs=load_mm_program_inputs(self.report_path)
self.assertEqual(len(rows),2143);self.assertEqual(len(inputs),28)
self.assertEqual(sum(len(r['program_contexts']) for r in rows),4326)
actual={r['program_id']:r for r in rows}
for gold in self.fixture['independent_inventory']['inventory']:
r=actual[gold['paper_id']]
self.assertEqual((r['title'],r['authors'],r['track']),
(gold['title'],gold['authors'],gold['track_literal']))
self.assertEqual(r['external_id'],'2026/'+gold['paper_id'])
self.assertEqual(r['status'],'unknown');self.assertEqual(r['identifiers'],{})
self.assertEqual(r['source_observed_status'],'listed_in_official_program')
self.assertFalse(r['publication_identity_verified']);self.assertFalse(r['final_decision_verified'])
self.assertFalse(r['contribution_type_verified'])
self.assertEqual([c['source_pointer'] for c in r['program_contexts']],gold['locations'])
self.assertEqual({r['program_id'] for r in rows if not r['authors']},{'mfp4971','mfp7801'})
self.assertTrue(all('unknown is not a source decision' in i['manifest']['scope'] for i in inputs))
self.assertFalse(any(self.root.rglob('*.manifest.json')))
def test_untrusted_absolute_file_paths_are_not_followed(self):
self.change_report(lambda r:[f.update(file='/untrusted/'+Path(f['file']).name) for f in r['files']])
rows,inputs=load_mm_program_inputs(self.report_path)
self.assertEqual(len(rows),2143)
self.assertTrue(all(Path(i['file']).parent==self.report_path.parent for i in inputs))
def test_program_files_are_not_silently_accepted_by_regular_ingestion_input_loader(self):
report=json.loads(self.report_path.read_text())
with self.assertRaises(FileNotFoundError):load_inputs([report['files'][0]['file']])
def test_corrupt_jsonl_fails_before_connection_or_output(self):
report=json.loads(self.report_path.read_text());path=Path(report['files'][0]['file'])
path.write_bytes(path.read_bytes()+b' ')
self.assert_rejected_before_database()
def test_rehashed_forged_identifiers_decisions_and_contexts_rejected(self):
original=self.report_path.read_bytes();report=json.loads(original);path=Path(report['files'][0]['file']);raw=path.read_bytes()
for field,value in [('identifiers',{'openreview':'invented'}),('status','accepted'),('contexts',[])]:
path.write_bytes(raw);self.report_path.write_bytes(original)
lines=raw.splitlines();row=json.loads(lines[0]);row[field]=value;lines[0]=json.dumps(row).encode()
changed=b'\n'.join(lines)+b'\n';path.write_bytes(changed)
self.change_report(lambda r:r['files'][0].update(file_sha256=hashlib.sha256(changed).hexdigest()))
with self.subTest(field=field):self.assert_rejected_before_database()
def test_missing_or_repeated_track_rejected(self):
original=self.report_path.read_bytes()
for kind in ('missing','repeated'):
self.report_path.write_bytes(original)
if kind=='missing':self.change_report(lambda r:r['files'].pop())
else:self.change_report(lambda r:r['files'].__setitem__(1,r['files'][0]))
with self.subTest(kind=kind):self.assert_rejected_before_database()
def test_raw_source_corruption_or_symlink_rejected(self):
path=self.report_path.parent/'evidence/program-data.json';raw=path.read_bytes()
path.write_bytes(raw+b' ');self.assert_rejected_before_database()
path.write_bytes(raw);saved=path.with_name('original.json');path.rename(saved);path.symlink_to(saved)
self.assert_rejected_before_database()
def test_mixed_input_modes_rejected_before_connection(self):
with patch('paper_atlas.audits.source_identity.ReadConnection') as connection:
for files,program in [([],None),([Path('unused')],self.report_path)]:
with self.assertRaisesRegex(ValueError,'Choose source files'):
audit(files,self.root/'out',pg_service='unused',pg_schema='research',mm_program_report=program)
connection.assert_not_called()
+174
View File
@@ -0,0 +1,174 @@
import copy
from collections import Counter
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
from urllib.parse import parse_qs, urlsplit
from paper_atlas.collectors import neurips_program as program
FIXTURES = Path(__file__).parent/'fixtures'
RAW = gzip.decompress((FIXTURES/'neurips2026-program.json.gz').read_bytes())
RECEIPTS = json.loads((FIXTURES/'neurips2026-receipts.json').read_text())
EVIDENCE = {'url': program.URL, 'observed_at': RECEIPTS['receipts'][0]['finished_at']}
class NeuripsProgramTests(unittest.TestCase):
def sample(self):
rows = json.loads(RAW)['results']
oral = next(r for r in rows if r['id'] == 154866)
poster = next(r for r in rows if r['paper_url'] == oral['paper_url'] and r['event_type'] == 'Poster')
return copy.deepcopy(poster), copy.deepcopy(oral)
def payload(self, rows):
return json.dumps({'count': len(rows), 'next': None, 'previous': None, 'results': rows})
def snapshots(self, folder):
folder.mkdir()
(folder/'program-json.response').write_bytes(RAW)
(folder/'receipts.json').write_text(json.dumps(RECEIPTS))
return folder
def test_full_snapshot_tracks_and_all_titles_authors_affiliations(self):
rows, held, duplicates, folded = program.parse_program(RAW, EVIDENCE)
self.assertEqual((len(rows), len(held), len(duplicates), folded), (9004, 139, 1, 132))
self.assertEqual(Counter(r['track'] for r in rows),
{'main': 7896, 'evaluations_datasets': 971, 'position': 137})
expected = {}
for e in json.loads(RAW)['results']:
if e['sourceurl'] in program.GROUPS and e['event_type'] == 'Poster':
forum = parse_qs(urlsplit(e['paper_url']).query)['id'][0]
expected[forum] = e
self.assertEqual(len(expected), 9004)
for r in rows:
e = expected[r['identifiers']['openreview']]
self.assertEqual(r['title'], e['name'])
self.assertEqual(r['authors'], [a['fullname'] for a in e['authors']])
self.assertEqual(r['metadata']['author_affiliations'], [a.get('institution') for a in e['authors']])
self.assertEqual(r['raw_decision'], e['decision'])
self.assertEqual(r['status'], 'accepted')
self.assertNotIn('decision_date', r)
self.assertIsNone(r['abstract'])
self.assertEqual(r['year'], 2026)
self.assertEqual(duplicates[0]['event_id'], 154866)
def test_same_forum_folds_presentations_and_preserves_signed_source_ids(self):
poster, oral = self.sample()
rows, held, duplicates, folded = program.parse_program(self.payload([oral, poster, oral]), EVIDENCE)
row, = rows
self.assertEqual((len(held), len(duplicates), folded), (0, 1, 1))
self.assertEqual({p['sourceid'] for p in row['metadata']['presentations']},
{poster['sourceid'], oral['sourceid']})
self.assertLess(oral['sourceid'], 0)
self.assertEqual({t['value'] for t in row['tags']}, {'Poster', 'Oral'})
self.assertTrue(all(t['namespace'] == 'neurips_program:presentation_format' for t in row['tags']))
def test_identical_title_and_authors_in_distinct_forums_remain_distinct(self):
poster, _ = self.sample(); other = copy.deepcopy(poster)
other.update(id=999999, uid='0'*32, sourceid=999999, paper_url='https://openreview.net/forum?id=otherForum7',
virtualsite_url='/virtual/2026/poster/999999')
rows, _, _, _ = program.parse_program(self.payload([poster, other]), EVIDENCE)
self.assertEqual(len(rows), 2)
self.assertEqual(len({r['external_id'] for r in rows}), 2)
def test_conflicting_event_ids_or_same_forum_bibliography_are_rejected(self):
poster, oral = self.sample()
for field in ('name', 'authors', 'sourceurl', 'decision'):
changed = copy.deepcopy(oral)
if field == 'authors':
changed['authors'][0]['fullname'] = 'Different Author'
elif field == 'sourceurl':
changed[field] = 'https://openreview.net/group?id=NeurIPS.cc/2026/Position_Paper_Track'
elif field == 'decision':
changed[field] = 'Accept (poster)'
else:
changed[field] += ' changed'
with self.subTest(field=field), self.assertRaises(ValueError):
program.parse_program(self.payload([poster, changed]), EVIDENCE)
changed = copy.deepcopy(poster); changed['name'] += ' changed'
with self.assertRaises(ValueError):
program.parse_program(self.payload([poster, changed]), EVIDENCE)
def test_unreviewed_origin_decision_visibility_and_link_are_held(self):
poster, _ = self.sample()
mutations = [{'sourceurl': 'journal-track/NeurIPS_2026-Posters_TMLR.xlsx'},
{'sourceurl': 'neurips2026-bridging-the-future'},
{'sourceurl': None}, {'sourceurl': 'https://openreview.net/group?id=NeurIPS.cc/2027/Conference'},
{'decision': 'Reject'}, {'visible': False},
{'paper_url': 'https://other.example/forum?id=anotherID7'}]
for mutation in mutations:
changed = copy.deepcopy(poster); changed.update(id=999999, virtualsite_url='/virtual/2026/poster/999999')
changed.update(mutation)
rows, held, _, _ = program.parse_program(self.payload([poster, changed]), EVIDENCE)
self.assertEqual((len(rows), len(held)), (1, 1))
self.assertEqual(held[0]['raw_event'], changed)
def test_rejects_truncation_pagination_invalid_url_and_missing_authors(self):
poster, _ = self.sample()
raw = json.loads(self.payload([poster]))
bad = [dict(raw, count=2), dict(raw, next='https://example.com/next'),
{k: v for k, v in raw.items() if k != 'previous'}]
for payload in bad:
with self.assertRaises(ValueError):
program.parse_program(json.dumps(payload), EVIDENCE)
for mutation in [{'authors': []}, {'virtualsite_url': '/virtual/2025/poster/154865'}, {'id': True}]:
changed = copy.deepcopy(poster); changed.update(mutation)
with self.assertRaises(ValueError):
program.parse_program(self.payload([changed]), EVIDENCE)
def test_frozen_collection_is_partial_and_no_http_or_database_write(self):
with tempfile.TemporaryDirectory() as tmp, patch.object(program, 'fetch', side_effect=AssertionError('No HTTP')):
root = Path(tmp); source = self.snapshots(root/'source')
report = program.collect(root/'out', snapshots=source)
self.assertEqual(report['records'], 9004)
self.assertEqual(len(report['files']), 3)
self.assertFalse(report['database_written'])
self.assertFalse(report['pdfs_downloaded'])
for m in report['files']:
self.assertEqual(m['status'], 'partial')
self.assertEqual(m['missing_abstract_count'], m['count'])
self.assertEqual(hashlib.sha256(Path(m['file']).read_bytes()).hexdigest(), m['file_sha256'])
with self.assertRaises(ValueError):
program.collect(root/'out', snapshots=source)
def test_frozen_receipt_tamper_path_symlink_status_and_duplicate(self):
for mode in ('tamper', 'path', 'symlink', 'status', 'duplicate'):
with self.subTest(mode=mode), tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); source = self.snapshots(root/'source')
receipts = copy.deepcopy(RECEIPTS)
if mode == 'tamper':
(source/'program-json.response').write_text('bad')
elif mode == 'path':
receipts['receipts'][0]['file'] = '../outside.json'
elif mode == 'symlink':
(root/'outside.json').write_bytes(RAW)
(source/'program-json.response').unlink()
(source/'program-json.response').symlink_to(root/'outside.json')
elif mode == 'status':
receipts['receipts'][0]['status'] = 403
else:
receipts['receipts'].append(copy.deepcopy(receipts['receipts'][0]))
(source/'receipts.json').write_text(json.dumps(receipts))
with self.assertRaises(ValueError):
program.collect(root/'out', snapshots=source)
self.assertFalse((root/'out/neurips-program-2026.json').exists())
def test_online_mode_only_requests_fixed_program_metadata(self):
poster, _ = self.sample(); raw = self.payload([poster]).encode()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); cache = root/'cache'; cache.mkdir()
receipt = {'retrieved_at': EVIDENCE['observed_at'], 'url': program.URL}
(cache/hashlib.sha256(program.URL.encode()).hexdigest()).with_suffix('.json').write_text(json.dumps(receipt))
with patch.object(program, 'fetch', return_value=raw) as fetch:
report = program.collect(root/'out', cache=cache)
fetch.assert_called_once_with(program.URL, cache, program.LIMIT, delay=1)
self.assertEqual(report['records'], 1)
def test_frozen_fixture_preserves_actual_response_bytes(self):
receipt, = RECEIPTS['receipts']
self.assertEqual(hashlib.sha256(RAW).hexdigest(), receipt['sha256'])
self.assertEqual(len(RAW), receipt['bytes'])
+32
View File
@@ -46,6 +46,38 @@ class MetadataTests(unittest.TestCase):
self.assertEqual(len(rows[0]['metadata']['source_versions']),2)
self.assertEqual(rows[0]['metadata']['date'],'2023-12-02')
def test_publisher_preface_is_not_an_accepted_paper(self):
config = b'shortname: UAI\nyear: 2024\nbooktitle: UAI\n'
accepted = '---\nid: paper1\nlayout: inproceedings\ntitle: Paper\nabstract: Abstract\n---\n'
preface = '---\nid: kiyavash24a\nlayout: inproceedings\ntitle: Volume Preface\nsection: Preface\n---\n'
posts = [('paper.md', accepted), ('preface.md', preface)]
with tempfile.TemporaryDirectory() as tmp, patch(
'paper_atlas.collectors.pmlr.fetch', return_value=config,
), patch('paper_atlas.collectors.pmlr.metadata_texts', return_value=iter(posts)):
result = collect_volume(244, tmp, tmp)
rows = [json.loads(line) for line in Path(result['file']).read_text().splitlines()]
self.assertEqual(result['excluded_preface_ids'], ['v244/kiyavash24a'])
self.assertEqual(result['files'][0]['count'], 1)
self.assertEqual([row['external_id'] for row in rows], ['v244/paper1'])
def test_corl_2021_sections_keep_blue_sky_apart_from_contributed_papers(self):
config = b'shortname: CoRL\nyear: 2021\nbooktitle: Proceedings of the 5th Conference on Robot Learning\n'
paper = '---\nid: {id}\nlayout: inproceedings\ntitle: Paper\nabstract: Abstract\nsection: {section}\n---\n'
posts = [('one.md', paper.format(id='one', section='Contributed Papers')),
('two.md', paper.format(id='two', section='Blue Sky Papers'))]
with tempfile.TemporaryDirectory() as tmp, patch('paper_atlas.collectors.pmlr.fetch', return_value=config), patch(
'paper_atlas.collectors.pmlr.metadata_texts', return_value=iter(posts),
):
result = collect_volume(164, tmp, tmp)
self.assertEqual(result['track'], 'mixed')
files = {manifest['track']: Path(manifest['file']) for manifest in result['files']}
self.assertEqual({key: path.name for key, path in files.items()},
{'main': 'pmlr-v164.jsonl', 'blue_sky': 'pmlr-v164-blue_sky.jsonl'})
rows = {track: json.loads(path.read_text()) for track, path in files.items()}
self.assertEqual([(rows[t]['external_id'], rows[t]['track'], rows[t]['metadata']['pmlr_section'])
for t in ('main', 'blue_sky')],
[('v164/one', 'main', 'Contributed Papers'), ('v164/two', 'blue_sky', 'Blue Sky Papers')])
def test_conflicting_duplicate_posts_do_not_replace_previous_collection(self):
config=b'shortname: CoRL\nyear: 2023\nbooktitle: CoRL\n'
paper='---\nid: paper1\nlayout: inproceedings\ntitle: {title}\nabstract: Abstract\n---\n'
+31 -1
View File
@@ -15,7 +15,7 @@ from paper_atlas.db.backend import open_store, open_read_connection
from paper_atlas.db.store import Store
from paper_atlas.ingestion import arxiv
from paper_atlas.ingestion.backfill import backfill
from paper_atlas.ingestion.records import ingest_file
from paper_atlas.ingestion.records import coverage_options, ingest_file, require_incremental_parent
from paper_atlas.postgres.client import connect, ReadConnection
from paper_atlas.postgres.migration import migrate
from paper_atlas.postgres.schema import quote
@@ -114,6 +114,36 @@ class PostgreSQLIngestionTests(unittest.TestCase):
self.assertEqual(run[0],1)
self.assertEqual(json.loads(run[1])['coverage']['imported_count'],3)
def test_incremental_parent_preflight_uses_readonly_postgres_rows_and_keeps_guards(self):
rows = [self.row(source='dblp', external=key, status='accepted', year=2001, venue='UAI')
for key in ('preflight1', 'preflight2')]
path = self.file('preflight-parent', rows)
target = path.with_suffix('.manifest.json')
manifest = json.loads(target.read_text())
manifest['status'] = 'partial'
target.write_text(json.dumps(manifest))
self.ingest(path)
proposed = dict(manifest, coverage_mode='incremental', count=1,
coverage_previous_count=2, coverage_previous_expected_count=2,
coverage_expected_count=4)
with closing(ReadConnection(self.service, self.schema)) as c:
self.assertEqual(c.execute('SHOW transaction_read_only').fetchone()[0], 'on')
source = c.execute("SELECT id FROM sources WHERE name='dblp'").fetchone()[0]
before = {table: c.execute('SELECT count(*) FROM '+table).fetchone()[0]
for table in ('papers', 'source_records', 'submissions', 'decisions', 'ingest_runs')}
coverage = [dict(row) for row in c.execute('SELECT * FROM edition_sources ORDER BY edition_id,source_id,list_url')]
require_incremental_parent(c, source, proposed, coverage_options(proposed))
for changes, error in (({'coverage_previous_count': 1}, 'parent changed'),
({'coverage_previous_expected_count': 3}, 'parent changed'),
({'list_url': 'https://example.org/other-list'}, 'unambiguous source listing')):
with self.subTest(changes=changes):
stale = dict(proposed, **changes)
with self.assertRaisesRegex(ValueError, error):
require_incremental_parent(c, source, stale, coverage_options(stale))
self.assertEqual({table: c.execute('SELECT count(*) FROM '+table).fetchone()[0]
for table in before}, before)
self.assertEqual([dict(row) for row in c.execute('SELECT * FROM edition_sources ORDER BY edition_id,source_id,list_url')], coverage)
def test_incremental_postgres_bound_failure_rolls_back_rows_and_summary(self):
listing='https://example.org/uai/2001'
rows=[self.row(source='dblp',external=key,status='accepted',year=2001,venue='UAI')
+140
View File
@@ -0,0 +1,140 @@
from contextlib import closing, redirect_stdout
from hashlib import sha256
import io
import json
import os
from pathlib import Path
from tempfile import TemporaryDirectory
import unittest
import uuid
from paper_atlas.audits.source_identity import entity_packet
from paper_atlas.cli import main
from paper_atlas.db.edition_scopes import resolve
from paper_atlas.db.store import Store
from paper_atlas.ingestion.publication_reconciliation import PROGRAMME, PUBLISHER, packet_digest
from paper_atlas.postgres.client import ReadConnection, connect
from paper_atlas.postgres.migration import migrate
from paper_atlas.postgres.schema import quote
class PublicationReconciliationTests(unittest.TestCase):
def setUp(self):
directory = TemporaryDirectory()
self.addCleanup(directory.cleanup)
self.root = Path(directory.name)
self.db = self.root / 'db.sqlite'
self.store = Store(self.db)
self.conn = self.store.conn
self.addCleanup(self.conn.close)
self.programme_url = 'https://eccv.ecva.net/Conferences/2026/AcceptedPapers'
self.publisher_url = 'https://link.springer.com/conference/eccv'
programme = self.store.source(PROGRAMME, self.programme_url)
publisher = self.store.source(PUBLISHER, self.publisher_url)
self.entries = [self.programme_attempt(str(i)) for i in range(1, 4)]
title = 'A distinct chapter already integrated in the main track'
paper, record = self.store.record(PUBLISHER, 'prior', self.publisher_url, title, 'Text', [])
self.target = self.store.accepted(paper, record, 'ECCV', 2026, 'main', 'prior', self.publisher_url)
self.original = self.entries[0]['move_from_edition_id']
for entry in self.entries:
entry['move_to_edition_id'] = self.target
self.conn.executemany('''INSERT INTO edition_sources
(edition_id,source_id,list_url,status,expected_count,imported_count) VALUES(?,?,?,'partial',?,?)''',
[(self.original, programme, self.programme_url, 2834, 3),
(self.target, publisher, self.publisher_url, 2835, 1)])
self.conn.commit()
def programme_attempt(self, number):
title = 'A programme observation for continuing research ' + number
url = self.programme_url + '/' + number
authors = ['Ada Example', 'Sam Example']
paper, record = self.store.record(PROGRAMME, number, url, title, 'Programme text', authors)
original = self.store.accepted(paper, record, 'ECCV', 2026, 'program_unclassified', number, url)
other, old_record = self.store.record('openreview', 'test-' + number, url, title, 'Programme text', authors)
self.assertEqual(other, paper)
self.store.decision(paper, old_record, 'ICLR', 2025, 'main', 'test-' + number, url, 'rejected', 'Reject')
packet = entity_packet(self.conn, paper)
attempt = next(row for row in packet['attempts'] if row['source_record_id'] == record)
doi = '10.1007/978-3-032-00000-1_' + number
chapter = 'https://link.springer.com/chapter/' + doi
row = {'source': PUBLISHER, 'external_id': doi, 'url': chapter, 'evidence_url': chapter,
'venue': 'ECCV', 'year': 2026, 'track': 'main', 'status': 'accepted',
'title': title, 'authors': authors, 'abstract': 'Publisher text',
'observed_at': '2026-11-18T00:00:00Z', 'raw_decision': 'Publication observation',
'identifiers': {'doi': doi},
'submission_identifiers': [{'scheme': 'publication_doi', 'value': doi}],
'metadata': {'publisher_chapter_evidence': {'sha256': 'a' * 64}},
'tags': [{'namespace': PUBLISHER + ':format', 'value': 'chapter'}]}
return {'doi': doi, 'retained_paper_id': paper, 'retained_programme_record_id': record,
'retained_submission_id': attempt['id'], 'retained_programme_decision_id': attempt['decisions'][0]['id'],
'move_from_edition_id': original, 'source_row': row, 'before_packet_sha256': packet_digest(packet)}
def run_plan(self, entries, *database):
path = self.root / 'plan.json'
raw = json.dumps({'status': 'readonly_same_submission_reconciliation_plan', 'database_written': False,
'plans': entries, 'guarded_same_submission_plans': len(entries)}).encode()
path.write_bytes(raw)
main(['maintain', 'eccv-publication-reconciliation', *(database or ('--db', str(self.db))),
'--plan', str(path), '--plan-sha256', sha256(raw).hexdigest(), '--springer-previous-count', '1'])
def test_preserves_history_and_updates_all_three_coverage_scopes(self):
entry = self.entries[0]
before = entity_packet(self.conn, entry['retained_paper_id'])
self.run_plan([entry])
packet = entity_packet(self.conn, entry['retained_paper_id'])
self.assertEqual(packet['paper'], before['paper'])
programme, other = packet['attempts']
self.assertEqual((programme['id'], programme['edition_id']), (entry['retained_submission_id'], self.target))
self.assertEqual(other, before['attempts'][1])
self.assertEqual(programme['decisions'][0], before['attempts'][0]['decisions'][0])
self.assertEqual([row['status'] for row in programme['decisions']], ['accepted', 'accepted'])
self.assertEqual({r['source'] for r in programme['sources']}, {PROGRAMME, PUBLISHER})
self.assertEqual(len(packet['source_records']), 3)
self.assertEqual(resolve(self.conn, entry['retained_programme_record_id'], '1',
'ECCV', 2026, 'program_unclassified', None), self.target)
coverage = {(edition, source): (status, expected, imported)
for edition, source, status, expected, imported in self.conn.execute('''SELECT
e.track,s.name,c.status,c.expected_count,c.imported_count FROM edition_sources c
JOIN editions e ON e.id=c.edition_id JOIN sources s ON s.id=c.source_id''')}
self.assertEqual(coverage, {('program_unclassified', PROGRAMME): ('partial', 2834, 2),
('main', PROGRAMME): ('partial', None, 1),
('main', PUBLISHER): ('partial', 2835, 2)})
with self.assertRaisesRegex(ValueError, 'already applied'):
self.run_plan([entry])
def test_changed_history_rolls_back_earlier_observation(self):
first, second = self.entries[:2]
stale = {**second, 'before_packet_sha256': 'b' * 64}
packet = entity_packet(self.conn, first['retained_paper_id'])
with self.assertRaisesRegex(ValueError, 'Reviewed paper history changed'):
self.run_plan([first, stale])
self.assertEqual(entity_packet(self.conn, first['retained_paper_id']), packet)
self.assertIsNone(self.conn.execute(
"SELECT 1 FROM identifiers WHERE scheme='doi' AND value=?", (first['doi'],)).fetchone())
self.assertEqual(self.conn.execute('SELECT count(*) FROM edition_sources').fetchone()[0], 2)
@unittest.skipUnless(os.environ.get('PAPER_ATLAS_TEST_PG_SERVICE'), 'Requires the remote PostgreSQL test service')
def test_postgres_write_verifies_history_from_the_read_backend(self):
service = os.environ['PAPER_ATLAS_TEST_PG_SERVICE']
schema = 'pa_eccv_' + uuid.uuid4().hex[:12]
def cleanup():
with connect(service) as conn:
for name, in conn.execute('SELECT nspname FROM pg_namespace WHERE starts_with(nspname,%s)', (schema,)):
conn.execute('DROP SCHEMA ' + quote(name) + ' CASCADE')
self.addCleanup(cleanup)
self.conn.close()
with redirect_stdout(io.StringIO()):
migrate(self.db, service, self.root / 'migration.json', schema=schema, min_free_gib=0)
entry = self.entries[0]
with closing(ReadConnection(service, schema)) as conn:
before = entity_packet(conn, entry['retained_paper_id'])
reviewed = {**entry, 'before_packet_sha256': packet_digest(before)}
self.run_plan([reviewed], '--pg-service', service, '--pg-schema', schema)
with closing(ReadConnection(service, schema)) as conn:
packet = entity_packet(conn, entry['retained_paper_id'])
self.assertEqual(packet['attempts'][1], before['attempts'][1])
self.assertEqual(packet['attempts'][0]['id'], entry['retained_submission_id'])
self.assertEqual(packet['attempts'][0]['edition_id'], self.target)
self.assertEqual(len(packet['attempts'][0]['decisions']), 2)
+79
View File
@@ -0,0 +1,79 @@
import base64
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import recsys2026 as c
class RecSys2026Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fixture=json.loads(gzip.decompress((Path(__file__).parent/'fixtures/recsys2026-source.json.gz').read_bytes()))
cls.files={n:base64.b64decode(raw) for n,raw in cls.fixture['files'].items()}
cls.body=cls.files[c.SNAPSHOT+'/recsys-contributions.html']
def materialize(self,root):
for name,raw in self.files.items():
path=root/name;path.parent.mkdir(parents=True,exist_ok=True);path.write_bytes(raw)
def test_all263_observations_against_independent_gold(self):
items=c.parse_program(self.body)
keys=self.fixture['independent_gold'][0].keys()
self.assertEqual([{k:r[k] for k in keys} for r in items],self.fixture['independent_gold'])
self.assertEqual(len(items),263);self.assertEqual(len({r['doi'] for r in items}),260)
self.assertEqual(sum(bool(r['review_flags']) for r in items),6)
variants=[r for r in items if r['doi']=='10.1145/3773078.3831839']
self.assertNotEqual(variants[0]['title'],variants[1]['title']);self.assertNotEqual(variants[0]['authors'],variants[1]['authors'])
self.assertNotEqual(variants[0]['abstract'],variants[1]['abstract'])
def test_installed_format_tracks_evidence_and_original_fields(self):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);src=root/'src';self.materialize(src);out=root/'out'
report=c.collect(out,snapshots=src)
self.assertEqual((report['records'],report['unique_dois'],report['missing_abstract_count']),(263,260,0))
self.assertFalse(report['database_written']);self.assertFalse(report['pdfs_downloaded']);self.assertEqual(report['network_requests'],0);self.assertEqual(report['approved_for_import'],0)
self.assertEqual(report['track_counts'],{k:n for k,_,n in c.TRACKS});self.assertEqual(report['duplicate_doi_observations'],6)
gold={r['locator']:r for r in self.fixture['independent_gold']};seen=set()
for manifest in report['files']:
path=Path(manifest['file']);raw=path.read_bytes();self.assertEqual(hashlib.sha256(raw).hexdigest(),manifest['file_sha256'])
rows=[json.loads(l) for l in raw.splitlines()];self.assertEqual(len(rows),manifest['count']);self.assertEqual(manifest['status'],'partial')
for r in rows:
item=r['metadata']['program_fields'];locator=item['locator'];seen.add(locator);expected=gold[locator]
for key in expected:self.assertEqual(item[key],expected[key])
self.assertEqual(r['external_id'],'2026/'+locator);self.assertEqual(r['title'],expected['title']);self.assertEqual(r['authors'],expected['authors']);self.assertEqual(r['abstract'],expected['abstract'])
self.assertEqual(r['track'],manifest['track']);self.assertEqual(r['identifiers'],{'doi':expected['doi']});self.assertEqual(r['submission_identifiers'],[{'scheme':'publication_doi','value':expected['doi']}])
self.assertEqual(r['tags'],[{'namespace':'recsys_program:contribution_type','value':expected['type_labels'][0]}]);self.assertFalse(r['metadata']['original_decision_signature_verified'])
self.assertEqual(seen,set(gold));self.assertEqual((out/'evidence/recsys-contributions.html').read_bytes(),self.body)
with self.assertRaisesRegex(ValueError,'Output exists'):c.collect(out,snapshots=src)
def test_edition_and_track_label_drift_rejected(self):
for old,new in [(b'RecSys 26 - Accepted Contributions',b'RecSys 25 - Accepted Contributions'),(b'>Long Papers</a>',b'>Workshops</a>'),(b"title='Research'",b"title='Unreviewed'")]:
with self.subTest(old=old),self.assertRaises(ValueError):c.parse_program(self.body.replace(old,new,1))
def test_duplicate_locator_missing_author_and_foreign_doi_rejected(self):
for old,new in [(b'accordion-1-slide-2"',b'accordion-1-slide-1"'),(b'by Md Aminul Islam, Kathryn Vasilaky and Elena Zheleva',b'by '),(b'https://doi.org/10.1145/3773078.3831824',b'https://doi.org/10.1145/9999999.3831824')]:
with self.subTest(old=old),self.assertRaises(ValueError):c.parse_program(self.body.replace(old,new,1))
def test_math_markup_requires_review_and_is_not_flattened(self):
changed=self.body.replace(b'Learning-to-rank (LTR)',b'Learning-to-rank <sup>2</sup> (LTR)',1)
with self.assertRaisesRegex(ValueError,'markup'):c.parse_program(changed)
def test_corruption_and_missing_receipt_body_preserve_failure(self):
for kind in ('manifest','body','missing'):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);src=root/'src';self.materialize(src);path=src/c.SNAPSHOT/('manifest.json' if kind=='manifest' else 'recsys-contributions.html')
if kind=='missing':path.unlink()
else:path.write_bytes(path.read_bytes()+b' ')
with self.assertRaises((ValueError,FileNotFoundError)):c.collect(root/'out',snapshots=src)
self.assertTrue((root/'out/failed.json').exists());self.assertFalse((root/'out/collection-report.json').exists())
def test_symlink_source_and_root_rejected(self):
for kind in ('source','root'):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);src=root/'src';self.materialize(src);path=src/c.SNAPSHOT/'recsys-contributions.html' if kind=='source' else src
original=path.with_name(path.name+'-original');path.rename(original);path.symlink_to(original,target_is_directory=kind=='root')
with self.assertRaisesRegex(ValueError,'Unsafe'):c.collect(root/'out',snapshots=src)
+203
View File
@@ -0,0 +1,203 @@
"""Metadata projection never requests OCR/review column pages or promotes mirror IDs."""
from collections import Counter
import hashlib
import importlib.util
import io
import json
from pathlib import Path
import re
import struct
import tempfile
import unittest
from unittest.mock import patch
import urllib.error
from paper_atlas.collectors.reviewarena import COLUMNS, COMMIT, collect, decision_claim, decision_track_claim, inventory, record
from paper_atlas.io.parquet_metadata import RangeSource, SparseFile, projection
class MemorySource:
def __init__(self, raw):
self.raw, self.size, self.bytes_read, self.receipts = raw, len(raw), 0, []
def read(self, start, length):
raw = self.raw[start:start+length]
self.bytes_read += len(raw)
self.receipts.append({'start': start, 'length': length, 'sha256': hashlib.sha256(raw).hexdigest()})
return raw
def fixture():
import pyarrow as pa
import pyarrow.parquet as pq
rows = []
for i, decision in enumerate(['Accept-Findings', 'Accept-Main', 'Reject', 'Withdrawn', None]):
row = {'forum_id': 'unverified-source-'+str(i)+'.xml', 'conference': 'emnlp', 'year': 2023,
'track': 'main', 'venue_id': 'source-venue-claim',
'paper_number': i, 'title': 'Metadata title '+str(i), 'abstract': 'Metadata abstract\x00 '+str(i),
'authors': ['Anonymous'] if i == 2 else ['Ada Author', 'Yi Researcher'],
'keywords': ['metadata'], 'venue': 'Source venue label', 'decision': decision,
'markdown': 'OCR_FULLTEXT_SENTINEL '+('private-ish fixture body '*10000),
'reviews_json': 'REVIEW_FULLTEXT_SENTINEL '+('fixture review '*10000),
'decision_comment': 'META_REVIEW_SENTINEL '+('fixture meta-review '*10000)}
rows.append(row)
sink = io.BytesIO(); pq.write_table(pa.Table.from_pylist(rows), sink, row_group_size=2, compression='snappy')
return sink.getvalue(), [{k: v for k, v in r.items() if k in COLUMNS} for r in rows]
class RangeHTTPTests(unittest.TestCase):
def response(self, data, status=206, start=2, size=10, etag='"stable"'):
response = io.BytesIO(data); response.status = status
response.headers = {'Content-Range': f'bytes {start}-{start+len(data)-1}/{size}', 'ETag': etag}
return response
def test_strict_range_and_changed_object_detection(self):
opener = unittest.mock.Mock(); opener.open.side_effect = [self.response(b'ab'), self.response(b'cd', start=4, etag='"changed"')]
source = RangeSource('https://example.org/public', 10, opener=opener)
self.assertEqual(source.read(2, 2), b'ab')
self.assertEqual(opener.open.call_args.args[0].get_header('Range'), 'bytes=2-3')
with self.assertRaisesRegex(ValueError, 'ETag'):
source.read(4, 2)
self.assertEqual(source.bytes_read, 2)
def test_no_full_file_fallback_or_denied_source_retry(self):
opener = unittest.mock.Mock(); response = self.response(b'ab', status=200)
response.read = unittest.mock.Mock(side_effect=AssertionError('Must not consume full body'))
opener.open.return_value = response
with self.assertRaisesRegex(ValueError, 'full download forbidden'):
RangeSource('https://example.org/public', 10, opener=opener).read(2, 2)
response.read.assert_not_called()
opener = unittest.mock.Mock(); opener.open.side_effect = urllib.error.HTTPError('https://cdn.example/signed?SECRET=hidden', 403, 'Forbidden', {}, None)
with self.assertRaisesRegex(RuntimeError, '^Metadata source HTTP 403; no retry or full-file fallback$'):
RangeSource('https://example.org/public', 10, opener=opener).read(2, 2)
self.assertEqual(opener.open.call_count, 1)
def test_sparse_footer_windows_are_synthetic_not_network_reads(self):
source = SparseFile(100, [(0, b'PAR1'), (95, b'footer')])
source.seek(90); self.assertEqual(source.read(10), b'\x00'*5+b'foote')
source.seek(-4, 2); self.assertEqual(source.tell(), 96)
with self.assertRaises(ValueError):
source.seek(-101, 2)
@unittest.skipUnless(importlib.util.find_spec('pyarrow'), 'Install mirrors extra on the approved remote runner')
class ParquetProjectionTests(unittest.TestCase):
def test_complete_selected_rows_and_no_excluded_page_requests(self):
import pyarrow.parquet as pq
raw, expected = fixture(); source = MemorySource(raw); rows, proof = projection(source, COLUMNS)
self.assertEqual(rows, expected)
metadata = pq.ParquetFile(io.BytesIO(raw)).metadata
excluded = []
for i in range(metadata.num_row_groups):
group = metadata.row_group(i)
for j in range(group.num_columns):
col = group.column(j)
if col.path_in_schema.split('.')[0] not in COLUMNS:
start = min(x for x in [col.data_page_offset, col.dictionary_page_offset] if x is not None and x > 0)
excluded.append((start, start+col.total_compressed_size))
for request in source.receipts:
a, b = request['start'], request['start']+request['length']
self.assertFalse(any(max(a, c) < min(b, d) for c, d in excluded))
self.assertFalse(proof['raw_parquet_saved']); self.assertFalse(proof['full_file_checksum_verified'])
self.assertLess(source.bytes_read, len(raw))
encoded = json.dumps(rows)+json.dumps(proof)
self.assertNotIn('OCR_FULLTEXT_SENTINEL', encoded); self.assertNotIn('REVIEW_FULLTEXT_SENTINEL', encoded)
self.assertNotIn('META_REVIEW_SENTINEL', encoded)
def test_wrong_schema_and_footer_fail_before_any_payload_download(self):
raw, _ = fixture(); source = MemorySource(raw)
with self.assertRaisesRegex(ValueError, 'Missing'):
projection(source, {'missing_column': 'string'})
self.assertEqual(len(source.receipts), 3)
source = MemorySource(raw)
with self.assertRaisesRegex(ValueError, 'type differs'):
projection(source, {**COLUMNS, 'year': 'string'})
self.assertEqual(len(source.receipts), 3)
bad = bytearray(raw); bad[-8:-4] = struct.pack('<I', len(raw))
source = MemorySource(bytes(bad))
with self.assertRaisesRegex(ValueError, 'footer'):
projection(source, COLUMNS)
self.assertEqual(len(source.receipts), 2)
def test_collector_output_preserves_claims_without_original_identity(self):
raw, _ = fixture(); item = {'path': 'data/emnlp-00000-of-00001.parquet', 'size': len(raw), 'lfs': {'oid': 'a'*64}}
with tempfile.TemporaryDirectory() as temp:
out = Path(temp)/'projected'
with patch('paper_atlas.collectors.reviewarena.inventory', return_value=[item]):
report = collect('emnlp', out, source_factory=lambda url, size: MemorySource(raw))
self.assertEqual(report['mirror_decision_counts'], {'accepted': 2, 'rejected': 1, 'withdrawn': 1, 'unknown': 1})
self.assertEqual(report['records'], 5); self.assertFalse(report['database_written'])
projected = [json.loads(line) for line in next(out.glob('*.jsonl')).read_text().splitlines()]
for row in projected:
self.assertEqual(row['identifiers'], {})
self.assertFalse(row['metadata']['original_forum_id_verified'])
self.assertFalse(row['metadata']['original_decision_signature_verified'])
self.assertNotIn('status', row)
self.assertIn(COMMIT, row['external_id'])
self.assertEqual(projected[2]['authors'], ['Anonymous'])
self.assertEqual(projected[2]['metadata']['forum_id_claim'], 'unverified-source-2.xml')
self.assertEqual(projected[0]['track'], 'main')
self.assertEqual(projected[0]['mirror_decision_track_claim'], 'findings')
all_saved=''.join(p.read_text() for p in out.iterdir())
self.assertNotIn('FULLTEXT_SENTINEL', all_saved); self.assertNotIn('META_REVIEW_SENTINEL', all_saved)
with self.assertRaisesRegex(ValueError, 'New output'):
collect('emnlp', out)
def test_offline_replay_reclassifies_literals_preserving_all_raw_fields_without_network(self):
raw, _ = fixture(); item = {'path': 'data/emnlp-00000-of-00001.parquet', 'size': len(raw), 'lfs': {'oid': 'a'*64}}
with tempfile.TemporaryDirectory() as temp, patch('paper_atlas.collectors.reviewarena.inventory', return_value=[item]):
out = Path(temp)/'v1'; collect('emnlp', out, source_factory=lambda url, size: MemorySource(raw))
file, = out.glob('*.jsonl'); before = [json.loads(x) for x in file.read_text().splitlines()]
# Mimic the first reviewed source version: new literal spellings were unknown.
for row in before[:2]:
row['mirror_decision_category'] = 'unknown'; row.pop('mirror_decision_track_claim')
file.write_text(''.join(json.dumps(x)+'\n' for x in before))
report_path = out/'collection-report.json'; report = json.loads(report_path.read_text())
report['files'][0]['file_sha256'] = hashlib.sha256(file.read_bytes()).hexdigest()
report_path.write_text(json.dumps(report)); report_hash = hashlib.sha256(report_path.read_bytes()).hexdigest()
no_network = unittest.mock.Mock(side_effect=AssertionError('Offline replay must not contact source'))
result = collect('emnlp', Path(temp)/'v2', from_projection=report_path, projection_sha256=report_hash, source_factory=no_network)
no_network.assert_not_called(); self.assertEqual(result['metadata_bytes_read'], 0)
self.assertEqual(result['source_projection_bytes'], report['metadata_bytes_read'])
self.assertEqual(result['mirror_decision_counts']['accepted'], 2)
self.assertEqual(result['mirror_decision_track_claim_counts'], {'findings': 1, 'main': 1, 'unspecified': 3})
new = [json.loads(x) for x in next((Path(temp)/'v2').glob('*.jsonl')).read_text().splitlines()]
self.assertEqual([r['raw_fields'] for r in new], [r['raw_fields'] for r in before])
self.assertEqual([r['source_locator'] for r in new], [r['source_locator'] for r in before])
with self.assertRaisesRegex(ValueError, 'hash differs'):
collect('emnlp', Path(temp)/'bad', from_projection=report_path, projection_sha256='0'*64, source_factory=no_network)
no_network.assert_not_called()
def test_failure_is_retained_without_source_payload_or_retries(self):
item = {'path': 'data/emnlp-00000-of-00001.parquet', 'size': 50, 'lfs': {'oid': 'a'*64}}
with tempfile.TemporaryDirectory() as temp:
out = Path(temp)/'failed'
with patch('paper_atlas.collectors.reviewarena.inventory', return_value=[item]), patch('paper_atlas.collectors.reviewarena.projection', side_effect=RuntimeError('private body example')):
with self.assertRaises(RuntimeError):
collect('emnlp', out, source_factory=lambda url, size: None)
report = json.loads((out/'failure.json').read_text())
self.assertEqual(report['status'], 'incomplete_do_not_import')
self.assertTrue(report['no_automatic_retry']); self.assertNotIn('private body', (out/'failure.json').read_text())
class MirrorSemanticsTests(unittest.TestCase):
def test_pinned_inventory_covers_all_seven_families_and_fifteen_shards(self):
splits = ['colm', 'corl', 'emnlp', 'iclr', 'icml', 'neurips', 'tmlr']
result = {s: inventory(s) for s in splits}
self.assertEqual(sum(len(v) for v in result.values()), 15)
self.assertEqual([len(result[s]) for s in splits], [1, 1, 1, 5, 1, 5, 1])
self.assertEqual(result['emnlp'][0]['size'], 90794691)
self.assertEqual(result['emnlp'][0]['lfs']['oid'], 'e9e3aab42d28ca32a02287ed0bd0f1f9e1f3af5cb8ed8d6a9bf28d4f630773da')
with self.assertRaises(ValueError):
inventory('uai')
def test_missing_or_ambiguous_decision_is_never_inferred_from_venue(self):
for literal in ['', None, 'Under review', 'Final venue pending', 'Accept maybe', 'Reject?']:
self.assertEqual(decision_claim(literal), 'unknown')
self.assertEqual(decision_claim('Desk Rejected'), 'desk_rejected')
self.assertEqual(decision_claim('Withdrawn'), 'withdrawn')
self.assertEqual(decision_claim('Accept (Findings)'), 'accepted')
self.assertEqual(decision_claim('Accept-Main'), 'accepted')
self.assertEqual(decision_claim('Accept-Findings'), 'accepted')
self.assertEqual(decision_track_claim('Accept-Findings'), 'findings')
self.assertIsNone(decision_track_claim('Accept (Poster)'))
+100
View File
@@ -0,0 +1,100 @@
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
from paper_atlas.collectors import rss2026 as rss
FIXTURE = Path(__file__).parent/'fixtures/rss2026-source.json.gz'
class Rss2026Tests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fixture=json.loads(gzip.decompress(FIXTURE.read_bytes()))
def setUp(self):
self.tmp=tempfile.TemporaryDirectory();self.addCleanup(self.tmp.cleanup)
self.root=Path(self.tmp.name);self.snap=self.root/'snapshots';self.snap.mkdir()
for name,text in self.fixture['pages'].items():(self.snap/name).write_bytes(text.encode())
(self.snap/'receipts.json').write_text(json.dumps(self.fixture['receipts']))
self.pages=self.fixture['pages'];self.index,self.program=self.lists()
def lists(self,**changes):
pages={**self.pages,**changes}
return rss.parse_lists(*(pages[n] for n in rss.PAGES))
def test_all210_records_match_independent_primary_inventory_and_evidence(self):
report=rss.collect(self.root/'out',snapshots=self.snap)
self.assertEqual(report['records'],210);self.assertFalse(report['database_written'])
self.assertFalse(report['pdfs_downloaded']);self.assertEqual(len(report['source_evidence']),214)
manifest,=report['files'];self.assertEqual(manifest['status'],'partial')
rows=[json.loads(l) for l in Path(manifest['file']).read_text().splitlines()]
for row,gold in zip(rows,self.fixture['independent_gold']):
self.assertEqual(row['external_id'],f"2026/p{gold['paper_id']:03d}")
for key in ('title','authors','abstract'):self.assertEqual(row[key],gold[key])
self.assertEqual(row['identifiers'],{'doi':gold['doi_raw'].lower()})
self.assertEqual(row['metadata']['publisher_date'],gold['publication_date'])
self.assertNotIn('submission_identifiers',row);self.assertEqual(row['track'],'main')
e=row['metadata']['source_evidence'];self.assertEqual(hashlib.sha256((self.root/'out'/e['file']).read_bytes()).hexdigest(),e['sha256'])
self.assertEqual(manifest['file_sha256'],hashlib.sha256(Path(manifest['file']).read_bytes()).hexdigest())
self.assertEqual(manifest['missing_abstract_count'],0)
def test_full_hidden_authors_are_separate_from_six_short_previews(self):
shortened=[p for p in self.program.values() if p['authors_complete']!=p['authors_preview']]
self.assertEqual(len(shortened),6)
p=rss.parse_paper(self.pages['p087.html'],87,self.index[87],self.program[87])
self.assertEqual(len(p['authors']),55)
self.assertFalse(p['program_variants'])
def test_six_reviewed_name_variants_preserve_original_strings(self):
for pid in rss.REVIEWED_AUTHOR_VARIANTS:
p=rss.parse_paper(self.pages[f'p{pid:03d}.html'],pid,self.index[pid],self.program[pid])
self.assertIn('reviewed_program_author_name_variant_not_person_alias',p['program_variants'])
self.assertNotEqual(', '.join(p['authors']),self.program[pid]['authors_complete'])
def test_reviewed_title_variant_is_not_an_automatic_erratum(self):
p=rss.parse_paper(self.pages['p089.html'],89,self.index[89],self.program[89])
self.assertTrue(p['title'].startswith('RLinf-VLA'))
self.assertTrue(self.program[89]['title'].startswith('RLux-VLA'))
self.assertIn('reviewed_program_title_variant_not_erratum',p['program_variants'])
def test_unreviewed_author_or_title_variant_stops(self):
for changed in [{'authors_complete':'An Unrelated Person'},{'title':'A different paper'}]:
with self.assertRaisesRegex(ValueError,'Unreviewed'):
rss.parse_paper(self.pages['p001.html'],1,self.index[1],{**self.program[1],**changed})
def test_demo_policy_cannot_be_reused_from2025(self):
with self.assertRaisesRegex(ValueError,'policy'):
self.lists(**{'cfp.html':self.pages['cfp.html'].replace('will not have a separate category','will have a separate category')})
with self.assertRaises(ValueError):
self.lists(**{'sponsor-demos.html':self.pages['sponsor-demos.html'].replace('Sponsor Demos','Demo Papers')})
def test_wrong_doi_year_pdf_or_missing_abstract_is_rejected(self):
html=self.pages['p001.html']
for old,new in [('10.15607/RSS.2026.XXII.001','10.15607/RSS.2025.XXI.001'),
('2026/07/13','2025/07/13'),('rss22/p001.pdf','rss22/p002.pdf'),('Abstract:','Summary:')]:
self.assertIn(old,html)
with self.assertRaises(ValueError):rss.parse_paper(html.replace(old,new),1,self.index[1],self.program[1])
def test_index_census_and_preview_tampering_stop(self):
with self.assertRaises(ValueError):self.lists(**{'index.html':self.pages['index.html'].replace('p001.html','p999.html')})
bad=self.pages['accepted.html'].replace('Huayi Zhou, Kui Jia','Somebody Else',1)
with self.assertRaisesRegex(ValueError,'prefix'):self.lists(**{'accepted.html':bad})
def test_snapshot_tamper_has_no_completion_marker_and_never_fetches(self):
p=self.snap/'p001.html';p.write_bytes(p.read_bytes()+b'changed')
with patch.object(rss,'fetch',side_effect=AssertionError('network must not be used')):
with self.assertRaisesRegex(ValueError,'receipt'):rss.collect(self.root/'out',snapshots=self.snap)
self.assertFalse((self.root/'out/collection-report.json').exists())
self.assertTrue((self.root/'out/failed.json').exists())
def test_existing_output_and_unsafe_receipt_are_rejected(self):
out=self.root/'existing';out.mkdir()
with self.assertRaises(ValueError):rss.collect(out,snapshots=self.snap)
receipts=[*self.fixture['receipts'],{**self.fixture['receipts'][0],'file':'../outside'}]
(self.snap/'receipts.json').write_text(json.dumps(receipts))
with self.assertRaisesRegex(ValueError,'Unsafe'):rss.collect(self.root/'unsafe',snapshots=self.snap)
self.assertTrue((self.root/'unsafe/failed.json').exists())
self.assertFalse((self.root/'unsafe/collection-report.json').exists())
+59
View File
@@ -0,0 +1,59 @@
"""RSS publisher/DBLP observations share one event without losing old decisions."""
from pathlib import Path
import json
import sqlite3
import tempfile
import unittest
from paper_atlas.db.submissions import identities_for_row
from tests.test_aamas_publication_identity import row, ingest
DOI='10.15607/rss.2026.xxii.041'
def rss(source,external,**kwargs):
return row(source,external,venue='RSS',year=2026,track='main',
identifiers=kwargs.pop('identifiers',{'doi':DOI}),**kwargs)
class RssPublicationIdentityTests(unittest.TestCase):
def test_only_verified_accepted_source_adds_publication_identity(self):
r=rss('rss_proceedings','2026/p041',identifiers={'doi':'https://doi.org/'+DOI.upper()})
self.assertEqual(identities_for_row(r),[('publication_doi',DOI)])
for status in ('rejected','desk_rejected','withdrawn','under_review','unknown'):
self.assertEqual(identities_for_row({**r,'status':status}),[])
self.assertEqual(identities_for_row({**r,'source':'unverified_rss_copy'}),[])
self.assertEqual(identities_for_row({**r,'identifiers':{'doi':'not-a-doi'}}),[])
def test_publisher_and_bibliography_both_orders_preserve_two_observations(self):
a=rss('rss_proceedings','2026/p041');b=rss('dblp','conf/rss/Example26')
for pair in ((a,b),(b,a)):
with self.subTest(first=pair[0]['source']),tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);db=root/'papers.sqlite'
for r in pair:ingest(db,root,r)
ingest(db,root,a)
with sqlite3.connect(db) as c:
self.assertEqual(c.execute('SELECT count(*) FROM papers').fetchone()[0],1)
self.assertEqual(c.execute('SELECT count(*) FROM submissions').fetchone()[0],1)
self.assertEqual(c.execute('SELECT count(*) FROM source_records').fetchone()[0],2)
self.assertEqual(c.execute('SELECT count(*) FROM submission_sources').fetchone()[0],2)
self.assertEqual(c.execute('SELECT count(*) FROM decisions').fetchone()[0],2)
self.assertEqual(c.execute('SELECT count(*) FROM decision_sources').fetchone()[0],2)
self.assertEqual(c.execute('SELECT scheme,value FROM submission_identifiers').fetchall(),[('publication_doi',DOI)])
metadata=[json.loads(r[0]) for r in c.execute('SELECT metadata_json FROM source_records')]
self.assertEqual({x['original_source'] for x in metadata},{'rss_proceedings','dblp'})
self.assertEqual(c.execute('PRAGMA foreign_key_check').fetchall(),[])
def test_prior_rejection_remains_independent_and_raw_evidence_unchanged(self):
with tempfile.TemporaryDirectory() as tmp:
root=Path(tmp);db=root/'papers.sqlite'
old=row('openreview_snapshot','old-forum',venue='ICLR',year=2025,track='main',
status='rejected',identifiers={'arxiv':'2501.00001','openreview':'old-forum'})
ingest(db,root,old)
with sqlite3.connect(db) as c:
before=c.execute('SELECT * FROM decisions').fetchall()
new=rss('rss_proceedings','2026/p041',identifiers={'arxiv':'2501.00001','doi':DOI})
ingest(db,root,new)
with sqlite3.connect(db) as c:
self.assertEqual(c.execute('SELECT * FROM decisions WHERE status=\'rejected\'').fetchall(),before)
self.assertEqual(c.execute('SELECT count(*) FROM submissions').fetchone()[0],2)
self.assertEqual(c.execute('SELECT count(*) FROM papers').fetchone()[0],1)
self.assertEqual(c.execute('SELECT count(*) FROM decisions WHERE status=\'accepted\'').fetchone()[0],1)
self.assertEqual(c.execute('PRAGMA foreign_key_check').fetchall(),[])
+142
View File
@@ -0,0 +1,142 @@
import copy
import gzip
import hashlib
import json
from pathlib import Path
import tempfile
import unittest
from paper_atlas.collectors import sdm2026 as c
class SDM2026Tests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fixture = json.loads(gzip.decompress((Path(__file__).parent/'fixtures/sdm2026-source.json.gz').read_bytes()))
cls.message = json.loads(cls.fixture['files']['sdm2026-crossref-research-v1/isbn-works.json'])['message']
def snapshots(self, root):
for name, text in self.fixture['files'].items():
path = root/name; path.parent.mkdir(parents=True, exist_ok=True); path.write_bytes(text.encode('utf-8'))
def test_publication_census_excludes_book_and_front_matter_not_cancelled_paper(self):
papers, excluded = c.registry_papers(self.message)
self.assertEqual(len(papers), 53)
self.assertEqual({x['doi'] for x in excluded}, {c.BOOK, c.BOOK+'.fm'})
self.assertIn(c.BOOK+'.7', {p['original']['DOI'] for p in papers})
marked = [p for p in papers if p['review_flags']]
self.assertEqual({p['original']['DOI'] for p in marked}, {c.BOOK+'.12', c.BOOK+'.35'})
for p in marked:
self.assertTrue(p['title'].endswith('*'))
self.assertIn('<sup>*</sup>', p['original']['title'][0])
def test_full_collection_preserves_separate_source_versions_and_unknown_negatives(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); self.snapshots(root/'src')
report = c.collect(root/'out', snapshots=root/'src')
self.assertEqual((report['records'], report['missing_abstract_count']), (53, 53))
self.assertFalse(report['database_written']); self.assertEqual(report['network_requests'], 0)
self.assertEqual(report['public_rejected_metadata'], 'unknown_anonymous_query_http403')
self.assertEqual(report['program_registry_author_sequence_differences'], 20)
manifest, = report['files']; self.assertEqual(manifest['status'], 'partial')
rows = [json.loads(line) for line in Path(manifest['file']).read_text().splitlines()]
originals = {x['DOI']: x for x in self.message['items'] if x['type'] == 'book-chapter'}
for row in rows:
self.assertEqual(row['metadata']['registry_fields'], originals[row['external_id']])
self.assertIsNone(row['abstract']); self.assertFalse(row['tags'])
self.assertEqual(row['identifiers'], {'doi': row['external_id']})
self.assertEqual(row['submission_identifiers'], [{'scheme': 'publication_doi', 'value': row['external_id']}])
self.assertEqual((row['status'], row['track']), ('accepted', 'proceedings_unclassified'))
self.assertEqual(row['metadata']['publication_dates']['published-online'], '2026-11-12')
sidecar = report['program_observations']
self.assertTrue(sidecar['not_an_import_manifest'])
observations = [json.loads(line) for line in Path(sidecar['file']).read_text().splitlines()]
self.assertEqual(len(observations), 53)
self.assertEqual(sum(x['public_page_fields'] is not None for x in observations), 52)
for observation in observations:
self.assertNotIn('status', observation); self.assertNotIn('identifiers', observation)
self.assertEqual(observation['record_kind'], 'source_observation_not_import_record')
cancelled, = [x for x in observations if x['cancelled_presentation']]
self.assertEqual(cancelled['title'], 'A Trajectory View of Statistical Policy Comparison')
self.assertIsNone(cancelled['public_page_fields'])
# The real source has conflicting author sets under the same title.
conflict = next(x for x in observations if x['title'].startswith('Scaffold-Aware Generative'))
self.assertEqual(conflict['public_page_fields']['source_reported_authors'], ['Xin Wang', 'Qinwen Ge'])
candidate, = conflict['registry_candidates']; self.assertFalse(candidate['author_sequence_exact'])
registry_row = next(x for x in rows if x['external_id'] == candidate['registry_doi_candidate'])
self.assertEqual(registry_row['authors'], ['Xin Wang', 'Yu Wang', 'Yunchao Liu', 'Jens Meiler', 'Tyler Derr'])
# Every copied source and manifest remains byte-identical, including CRLF.
for evidence in report['evidence']:
body = (root/'out'/evidence['output_file']).read_bytes()
self.assertEqual(body, self.fixture['files'][evidence['snapshot']+'/'+evidence['file']].encode('utf-8'))
self.assertEqual(hashlib.sha256(body).hexdigest(), evidence['sha256'])
with self.assertRaisesRegex(ValueError, 'Output exists'):
c.collect(root/'out', snapshots=root/'src')
def test_all_program_events_match_independent_inventory(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); self.snapshots(root)
loaded = {name: c.load_snapshot(root, name) for name in c.SNAPSHOTS}
papers, _ = c.registry_papers(self.message)
observations = c.program_observations(loaded, papers)
gold = {(x['session_url'], x['title']): x for x in self.fixture['program_gold']}
self.assertEqual({(x['session_url'], x['title']) for x in observations}, set(gold))
for item in observations:
original = gold[(item['session_url'], item['title'])]
for key in ('authors_literal', 'time_literal', 'cancelled_presentation'):
self.assertEqual(item[key], original[key])
def test_all_public_abstracts_and_source_reported_names_match_independent_gold(self):
files = self.fixture['files']
manifest = json.loads(files['sdm2026-public-abstract-research-v1/manifest.json'])
receipts = {r['url']: r for r in manifest['records']}
self.assertEqual(len(self.fixture['page_gold']), 52)
for gold in self.fixture['page_gold']:
receipt = receipts[gold['program_url']]
raw = files['sdm2026-public-abstract-research-v1/'+receipt['file']].encode('utf-8')
self.assertEqual(hashlib.sha256(raw).hexdigest(), gold['page_sha256'])
fields = c.talk_fields(raw, receipt['session_url'])
self.assertEqual(fields['title'], gold['title'])
self.assertEqual(fields['source_reported_authors'], gold['authors'])
self.assertEqual(fields['abstract'], gold['abstract'])
self.assertTrue(all('@' not in name for name in fields['source_reported_authors']))
def test_wrong_isbn_parent_doi_and_incomplete_census_rejected(self):
for kind in ('isbn', 'parent', 'repeat', 'type', 'year', 'author', 'markup', 'abstract', 'missing'):
with self.subTest(kind=kind):
message = copy.deepcopy(self.message)
row = next(x for x in message['items'] if x['type'] == 'book-chapter')
if kind == 'isbn': row['ISBN'] = ['9780000000000']
if kind == 'parent': row['relation']['is-part-of'][0]['id'] = 'https://doi.org/10.9999/other'
if kind == 'repeat': row['DOI'] = c.BOOK
if kind == 'type': row['type'] = 'other'
if kind == 'year': row['published']['date-parts'] = [[2025, 10, 31]]
if kind == 'author': row['author'][0]['sequence'] = 'additional'
if kind == 'markup': row['title'] = ['Changed <sup>2</sup> title']
if kind == 'abstract': row['abstract'] = 'Unreviewed new version'
if kind == 'missing': message['items'].pop()
with self.assertRaises(ValueError): c.registry_papers(message)
def test_foreign_session_and_changed_edition_rejected(self):
raw = self.fixture['files']['sdm2026-public-abstract-research-v1/162766.html'].encode()
url = 'https://meetings.siam.org/sess/dsp_programsess.cfm?SESSIONCODE=91511'
for changed in [raw.replace(b'sessioncode=91511', b'sessioncode=91507'),
raw.replace(b'2026 SIAM International Conference', b'2025 SIAM International Conference')]:
with self.assertRaises(ValueError): c.talk_fields(changed, url)
def test_corruption_preserves_failure_without_success_report(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); self.snapshots(root/'src')
(root/'src/sdm2026-public-abstract-research-v1/162766.html').write_bytes(b'corrupt')
with self.assertRaisesRegex(ValueError, 'receipt/body'):
c.collect(root/'out', snapshots=root/'src')
self.assertTrue((root/'out/failed.json').exists())
self.assertFalse((root/'out/collection-report.json').exists())
def test_source_symlink_rejected(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp); self.snapshots(root/'src')
p = root/'src/sdm2026-crossref-research-v1/isbn-works.json'
original = p.read_bytes(); p.unlink(); (root/'data.json').write_bytes(original); p.symlink_to(root/'data.json')
with self.assertRaisesRegex(ValueError, 'Unsafe'):
c.collect(root/'out', snapshots=root/'src')
+148
View File
@@ -0,0 +1,148 @@
import gzip
import hashlib
import json
import os
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
from paper_atlas.audits.source_identity import audit, classify, load_inputs
from paper_atlas.postgres.client import ReadConnection
def record(**updates):
row = dict(source='reviewed_program', external_id='2026/forum-a',
title='A sufficiently specific scientific paper title', authors=['Jane Doe', 'John Smith'],
venue='NeurIPS', year=2026, track='main', status='accepted', identifiers={},
source_record_hits=[], identifier_hits=[], title_candidate_ids=[])
row.update(updates)
return row
def write_input(root, rows):
path = root / 'source.jsonl'
raw = b''.join((json.dumps(row) + '\n').encode() for row in rows)
path.write_bytes(raw)
manifest = {k: rows[0][k] for k in ('source', 'venue', 'year', 'track')}
manifest.update(count=len(rows), file_sha256=hashlib.sha256(raw).hexdigest(),
file='/ignored/untrusted/location.jsonl', status='partial')
path.with_suffix('.manifest.json').write_text(json.dumps(manifest))
return path
class CandidateTests(unittest.TestCase):
def test_duplicate_names_do_not_equal_distinct_author_multiset(self):
row = record(authors=['Jane Doe', 'Jane Doe'], title_candidate_ids=[7])
result = classify(row, {7: {'title': row['title'], 'authors': ['Jane Doe']}})
self.assertEqual(result['kind'], 'partial_author_overlap_requires_review')
self.assertIn('duplicate_normalized_author_names', result['flags'])
self.assertFalse(result['comparisons'][0]['nonempty_author_multiset_equal'])
def test_arxiv_author_representation_and_order_match_but_never_approve(self):
row = record(title_candidate_ids=[7])
result = classify(row, {7: {'title': row['title'], 'authors': [['Smith', 'John', ''], ['Doe', 'Jane', '']]}})
self.assertEqual(result['kind'], 'one_exact_title_author_multiset_requires_review')
self.assertEqual(result['decision'], 'not_approved_for_import')
def test_binding_conflict_overrides_existing_source(self):
row = record(source_record_hits=[{'paper_id': 7}], identifier_hits=[{'paper_id': 8}])
entities = {pid: {'title': row['title'], 'authors': row['authors']} for pid in (7, 8)}
self.assertEqual(classify(row, entities)['kind'], 'conflicting_existing_bindings_hold')
def test_wrong_doi_binding_retains_author_title_disagreement(self):
row = record(identifier_hits=[{'paper_id': 7}])
result = classify(row, {7: {'title': 'Completely different work', 'authors': ['Somebody Else']}})
self.assertEqual(result['kind'], 'existing_identifier_binding_requires_review')
self.assertFalse(result['comparisons'][0]['normalized_title_equal'])
self.assertEqual(result['comparisons'][0]['author_name_overlap'], [])
def test_no_hit_is_not_novelty_and_missing_authors_never_agree(self):
self.assertEqual(classify(record(), {})['kind'], 'no_exact_match_not_proof_of_novelty')
row = record(authors=[], title_candidate_ids=[7])
result = classify(row, {7: {'title': row['title'], 'authors': []}})
self.assertEqual(result['kind'], 'no_author_agreement_hold')
def test_title_candidate_cap_is_explicit(self):
row = record(title_candidate_ids=list(range(21)))
entities = {pid: {'title': row['title'], 'authors': row['authors']} for pid in range(21)}
self.assertTrue(classify(row, entities)['title_candidates_truncated'])
self.assertEqual(classify(row, entities)['kind'], 'title_candidate_limit_reached_hold')
class InputTests(unittest.TestCase):
def setUp(self):
self.temp = tempfile.TemporaryDirectory()
self.addCleanup(self.temp.cleanup)
self.root = Path(self.temp.name)
def test_raw_line_hash_and_manifest_path_not_followed(self):
path = write_input(self.root, [record()])
rows, inputs = load_inputs([path])
self.assertEqual(rows[0]['raw_line_sha256'], hashlib.sha256(path.read_bytes()).hexdigest())
self.assertEqual(inputs[0]['count'], 1)
def test_hash_tamper_rejected_before_database_connection(self):
path = write_input(self.root, [record()])
path.write_bytes(path.read_bytes().replace(b'Jane Doe', b'Jane Roe'))
with patch('paper_atlas.audits.source_identity.ReadConnection') as connection:
with self.assertRaisesRegex(ValueError, 'hash mismatch'):
audit([path], self.root / 'out', pg_service='test', pg_schema='research')
connection.assert_not_called()
def test_manifest_scope_and_count_tamper_and_duplicate_sources(self):
path = write_input(self.root, [record()])
manifest_path = path.with_suffix('.manifest.json')
manifest = json.loads(manifest_path.read_text())
for key, value in [('year', 2025), ('count', 2)]:
altered = dict(manifest, **{key: value})
manifest_path.write_text(json.dumps(altered))
with self.assertRaises(ValueError):
load_inputs([path])
manifest_path.write_text(json.dumps(manifest))
with self.assertRaisesRegex(ValueError, 'Duplicate source'):
load_inputs([path, path])
def test_existing_output_never_replayed_and_failure_not_completion(self):
path = write_input(self.root, [record()])
out = self.root / 'out'
with patch('paper_atlas.audits.source_identity.ReadConnection', side_effect=RuntimeError('unavailable')):
with self.assertRaises(RuntimeError):
audit([path], out, pg_service='test', pg_schema='research')
self.assertTrue((out / 'failed.json').exists())
self.assertFalse((out / 'postgresql-preflight.json').exists())
with self.assertRaises(FileExistsError):
audit([path], out, pg_service='test', pg_schema='research')
@unittest.skipUnless(os.environ.get('PAPER_ATLAS_TEST_PG_SERVICE'), 'Requires the authorized remote PostgreSQL service')
class ReadOnlyIntegrationTests(unittest.TestCase):
def test_existing_binding_full_evidence_and_no_import_approval(self):
service = os.environ['PAPER_ATLAS_TEST_PG_SERVICE']
connection = ReadConnection(service, 'research')
try:
self.assertEqual(connection.execute('SHOW transaction_read_only').fetchone()[0], 'on')
hit = connection.execute("SELECT value,paper_id FROM identifiers WHERE scheme='arxiv' ORDER BY value LIMIT 1").fetchone()
self.assertIsNotNone(hit)
paper = connection.execute('SELECT title,authors_json FROM papers WHERE id=?', (hit['paper_id'],)).fetchone()
finally:
connection.close()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
path = write_input(root, [record(title=paper['title'], authors=json.loads(paper['authors_json']),
identifiers={'arxiv': hit['value']})])
report = audit([path], root / 'out', pg_service=service, pg_schema='research')
self.assertTrue(report['transaction_read_only'])
self.assertFalse(report['database_written'])
self.assertEqual(report['approved_for_import'], 0)
row, = report['entries']
self.assertIn(hit['paper_id'], [r['paper_id'] for r in row['identifier_hits']])
shard = report['entities'][str(hit['paper_id'])]
raw = (root / 'out' / shard['file']).read_bytes()
self.assertEqual(hashlib.sha256(raw).hexdigest(), shard['sha256'])
packet = json.loads(gzip.decompress(raw))
self.assertEqual(packet['paper']['id'], hit['paper_id'])
self.assertEqual(packet['paper']['title'], paper['title'])
self.assertEqual(packet['paper']['authors_json'], paper['authors_json'])
self.assertIn('attempts', packet)
self.assertTrue((root / 'out/postgresql-preflight.json').is_file())
+231
View File
@@ -0,0 +1,231 @@
"""Whole-source scope correction, stale refresh, full history and atomicity on both engines."""
from contextlib import closing, redirect_stdout
import copy
import hashlib
import io
import json
import os
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
import uuid
from paper_atlas.db.backend import open_store
from paper_atlas.db.edition_scopes import KEY
from paper_atlas.db.source_revisions import available, decode_payload, require_row, require_manifest
from paper_atlas.db.store import Store
from paper_atlas.ingestion.source_revisions import proposal, apply_plan, run, validate
from paper_atlas.ingestion.event_identity import database_identity, digest, values
from paper_atlas.ingestion.records import coverage_options, ingest_file
from paper_atlas.postgres.client import connect
from paper_atlas.postgres.migration import migrate
from paper_atlas.postgres.schema import quote
URL = 'https://example.org/volume'
def seed(path):
old = []
for i in range(4):
doi = '10.1234/publication'+str(i)
old.append({'source': 'fixture', 'venue': 'MM', 'year': 2026, 'track': 'main' if i == 0 else 'unclassified',
'external_id': doi, 'url': 'https://doi.org/'+doi, 'title': 'Distinct publication '+str(i),
'authors': ['Alice Author', 'Bob Writer'], 'abstract': None if i == 1 else 'Source abstract '+str(i),
'identifiers': {'doi': doi}, 'submission_identifiers': {'publication_doi': doi},
'status': 'accepted', 'raw_decision': 'Publication observation', 'evidence_url': URL,
'observed_at': '2026-06-01T00:00:00Z', 'tags': [{'namespace': 'fixture:track', 'value': 'main' if i == 0 else 'unclassified'}],
'metadata': {'original': i, 'program': None, 'scientific_work_identity_approved': False}})
current = copy.deepcopy(old)
current[1].update(track='main', abstract='Reviewed program abstract with NUL\x00 and SOH\x01')
current[1]['metadata']['program'] = {'id': 'p1', 'evidence_url': URL}
current[1]['tags'][0]['value'] = 'main'
store = Store(path)
for row in old[:3]:
p, r = store.record(row['source'], row['external_id'], row['url'], row['title'], row['abstract'], row['authors'], row['identifiers'], row['metadata'])
store.decision(p, r, 'MM', 2026, row['track'], row['external_id'], URL, 'accepted', row['raw_decision'],
identities=[('publication_doi', row['external_id'])], observed_at=row['observed_at'])
store.record_tags(p, r, 'fixture', row['tags'])
if row == old[1]:
store.conn.execute('UPDATE papers SET abstract=? WHERE id=?', ('Canonical preprint abstract', p))
p, other = store.record('prior', 'old-forum', 'https://example.org/prior', row['title'], 'Canonical preprint abstract', row['authors'], row['identifiers'])
store.decision(p, other, 'PRIOR', 2025, 'main', 'old-forum', 'https://example.org/prior', 'rejected', 'Reject', observed_at='2025-01-01T00:00:00Z')
# An unrelated source already has an attempt in the populated target edition.
p, r = store.record('other', 'other', 'https://example.org/other', 'Unrelated target paper', 'Other abstract', ['Someone Else'])
store.decision(p, r, 'MM', 2026, 'main', 'other', 'https://example.org/other', 'accepted', 'Published')
sid = store.conn.execute("SELECT id FROM sources WHERE name='fixture'").fetchone()[0]
for track, expected, imported in [('main', 1, 1), ('unclassified', 3, 2)]:
eid = store.conn.execute('SELECT id FROM editions WHERE year=2026 AND track=?', (track,)).fetchone()[0]
store.conn.execute("INSERT INTO edition_sources VALUES(?,?,?,'partial',?,?,?,'2026-06-01',NULL)", (eid, sid, URL, expected, imported, 'checkpoint'))
store.conn.commit(); store.conn.close()
return {'format': 1, 'source': 'fixture', 'venue': 'MM', 'year': 2026, 'event_key': '', 'list_url': URL,
'previous_rows': old, 'rows': current, 'evidence': [{'url': URL, 'sha256': 'a'*64}]}
class RevisionCases:
def store(self):
return open_store(**self.target)
def plan(self, c):
return proposal(c, self.inventory, database_identity(c, self.target.get('db')))
def test_large_payload_round_trips_and_protects_next_revision(self):
for key in ('previous_rows', 'rows'):
self.inventory[key][-1]['metadata']['evidence'] = '来源原文' * 100000
with closing(self.store().conn) as c:
plan = self.plan(c)
applied = apply_plan(c, plan)
c.commit()
saved = c.execute('SELECT records_json,plan_json FROM source_scope_revisions').fetchone()
expected = (self.inventory['rows'], plan)
for i, value in enumerate(expected):
self.assertTrue(saved[i].startswith('gzip+base64:v1:'))
self.assertLess(len(saved[i]), len(json.dumps(value, ensure_ascii=False).encode()) // 10)
self.assertEqual(decode_payload(saved[i]), value)
self.assertEqual(apply_plan(c, plan)['status'], 'already_applied')
sid = c.execute("SELECT id FROM sources WHERE name='fixture'").fetchone()[0]
require_row(c, sid, self.inventory['rows'][-1], {'list_url': URL}, {})
next_inventory = copy.deepcopy(self.inventory)
next_inventory['previous_rows'] = copy.deepcopy(self.inventory['rows'])
next_inventory['rows'][-1]['metadata']['reviewed'] = True
next_plan = proposal(c, next_inventory, database_identity(c, self.target.get('db')))
self.assertEqual(next_plan['before']['parent_sha256'], applied['version_sha256'])
def test_move_to_populated_target_preserves_full_history_and_before_images(self):
with closing(self.store().conn) as c:
plan = self.plan(c); self.assertEqual(len(plan['changes']), 1)
self.assertEqual(len(plan['before']['packet']['submissions']), 5)
before_papers = plan['before']['packet']['papers']
before_tags = plan['before']['packet']['paper_tags']
result = apply_plan(c, plan); c.commit()
self.assertEqual((result['events_moved'], result['records_changed']), (1, 1))
self.assertEqual(result['protected_decisions'], 5)
self.assertEqual(values(c.execute('SELECT * FROM papers ORDER BY id')), before_papers)
self.assertEqual(values(c.execute('SELECT * FROM paper_tags ORDER BY paper_id,tag_id,evidence_key')), before_tags)
self.assertEqual(c.execute("SELECT count(*) FROM decisions WHERE status='rejected'").fetchone()[0], 1)
self.assertEqual(values(c.execute('SELECT status,expected_count,imported_count,cursor,last_success_at,last_error FROM edition_sources ORDER BY edition_id')),
[['partial', 2, 2, 'checkpoint', '2026-06-01', None], ['partial', 2, 1, 'checkpoint', '2026-06-01', None]])
saved = json.loads(c.execute('SELECT plan_json FROM source_scope_revisions').fetchone()[0])
self.assertEqual(saved, plan)
self.assertEqual(apply_plan(c, plan)['status'], 'already_applied')
self.assertEqual(c.execute('SELECT count(*) FROM source_scope_revisions').fetchone()[0], 1)
def test_stale_direct_store_and_jsonl_refresh_fail_but_current_refresh_succeeds(self):
with closing(self.store().conn) as c:
plan = self.plan(c); apply_plan(c, plan); c.commit()
with closing(self.store().conn) as c:
store = object.__new__(Store); store.conn = c; store.event_identity = True
old = self.inventory['previous_rows'][1]
with self.assertRaisesRegex(ValueError, 'Stale source'):
store.record('fixture', old['external_id'], old['url'], old['title'], old['abstract'], old['authors'], old['identifiers'], old['metadata'])
c.rollback()
row = self.inventory['rows'][1]
p, r = store.record('fixture', row['external_id'], row['url'], row['title'], row['abstract'], row['authors'], row['identifiers'], row['metadata'])
self.assertEqual(c.execute('SELECT abstract FROM papers WHERE id=?', (p,)).fetchone()[0], 'Canonical preprint abstract')
self.assertEqual(json.loads(c.execute('SELECT metadata_json FROM source_records WHERE id=?', (r,)).fetchone()[0])[KEY][0]['target']['track'], 'main')
c.rollback()
path = self.root/'old.jsonl'; raw = (json.dumps(old)+'\n').encode(); path.write_bytes(raw)
path.with_suffix('.manifest.json').write_text(json.dumps({'source': 'fixture', 'venue': 'MM', 'year': 2026,
'track': 'unclassified', 'list_url': URL, 'status': 'partial', 'count': 1, 'file_sha256': hashlib.sha256(raw).hexdigest()}))
with self.assertRaisesRegex(ValueError, 'source snapshot'):
ingest_file(self.target.get('db'), path, **{k: v for k, v in self.target.items() if k != 'db'})
def test_unregistered_member_and_changed_program_metadata_are_rejected(self):
with closing(self.store().conn) as c:
apply_plan(c, self.plan(c)); c.commit()
sid = c.execute("SELECT id FROM sources WHERE name='fixture'").fetchone()[0]
cache = {}; unknown = copy.deepcopy(self.inventory['rows'][0]); unknown['external_id'] = '10.1234/unlisted'
with self.assertRaisesRegex(ValueError, 'absent from current'):
require_row(c, sid, unknown, {'list_url': URL}, cache)
bad = copy.deepcopy(self.inventory['rows'][1]); bad['metadata']['program'] = None
with self.assertRaisesRegex(ValueError, 'Stale source'):
require_row(c, sid, bad, {'list_url': URL}, cache)
good = copy.deepcopy(self.inventory['rows'][1]); good['metadata']['verified_work_anchor'] = {'reason': 'extra evidence'}
require_row(c, sid, good, {'list_url': URL}, cache)
with self.assertRaisesRegex(ValueError, 'coverage manifest'):
require_manifest(c, sid, {'venue': 'MM', 'year': 2026, 'track': 'main', 'list_url': URL, 'count': 1, 'status': 'partial'}, cache)
require_manifest(c, sid, {'venue': 'MM', 'year': 2026, 'track': 'main', 'list_url': URL, 'count': 2, 'status': 'partial'}, cache)
def test_stale_plan_and_target_identifier_collision_prevent_writes(self):
with closing(self.store().conn) as c:
plan = self.plan(c)
c.execute("UPDATE decisions SET raw_value='Additional evidence' WHERE status='rejected'")
with self.assertRaisesRegex(ValueError, 'Stale'):
apply_plan(c, plan)
c.rollback()
move = plan['changes'][0]
target_sub = c.execute('SELECT id FROM submissions WHERE edition_id=? LIMIT 1', (move['target_edition_id'],)).fetchone()[0]
c.execute('INSERT INTO submission_identifiers VALUES(?,?,?,?)', (move['target_edition_id'], 'publication_doi', move['external_id'], target_sub))
with self.assertRaisesRegex(ValueError, 'collision'):
self.plan(c)
c.rollback()
self.assertFalse(available(c))
def test_failed_postcheck_rolls_back_rows_extension_and_coverage(self):
with closing(self.store().conn) as c:
plan = self.plan(c)
with patch('paper_atlas.ingestion.source_revisions.verify', side_effect=ValueError('Injected verification failure')):
with self.assertRaisesRegex(ValueError, 'Injected'):
apply_plan(c, plan)
c.rollback()
self.assertFalse(available(c))
self.assertEqual(self.plan(c), plan)
def test_cli_binds_database_and_file_hash_without_writing_during_preflight(self):
inventory = self.root/'inventory.json'; inventory.write_text(json.dumps(self.inventory))
path = self.root/'plan.json'
args = {k: v for k, v in self.target.items() if k != 'db'}
run(self.target.get('db'), path, inventory=inventory, **args)
with closing(self.store().conn) as c:
self.assertFalse(available(c))
with self.assertRaisesRegex(ValueError, 'hash'):
run(self.target.get('db'), self.root/'bad.json', plan=path, plan_sha256='0'*64, **args)
report = run(self.target.get('db'), self.root/'applied.json', plan=path, plan_sha256=hashlib.sha256(path.read_bytes()).hexdigest(), **args)
self.assertEqual(report['events_moved'], 1)
def test_membership_identity_changes_and_incremental_shrink_remain_forbidden(self):
for mutate in [lambda x: x['rows'].pop(), lambda x: x['rows'][0].update(title='Different work'),
lambda x: x['rows'][0].update(status='rejected')]:
bad = copy.deepcopy(self.inventory); mutate(bad)
with self.assertRaises(ValueError):
validate(bad)
with self.assertRaisesRegex(ValueError, 'incremental'):
coverage_options({'coverage_mode': 'incremental', 'venue': 'MM', 'year': 2026, 'track': 'unclassified',
'status': 'partial', 'count': 1, 'coverage_previous_count': 2,
'coverage_previous_expected_count': 3, 'coverage_expected_count': 2})
class SQLiteSourceRevisionTests(RevisionCases, unittest.TestCase):
def setUp(self):
temp = tempfile.TemporaryDirectory(); self.addCleanup(temp.cleanup); self.root = Path(temp.name)
db = self.root/'source.sqlite'; self.inventory = seed(db); self.target = {'db': db}
@unittest.skipUnless(os.environ.get('PAPER_ATLAS_TEST_PG_SERVICE'), 'Requires approved remote PostgreSQL service')
def test_optional_revision_table_migrates_with_full_history(self):
with closing(self.store().conn) as c:
plan = self.plan(c); apply_plan(c, plan); c.commit()
service = os.environ['PAPER_ATLAS_TEST_PG_SERVICE']; schema = 'pa_rev_copy_'+uuid.uuid4().hex[:10]
self.addCleanup(drop_schema, service, schema)
with redirect_stdout(io.StringIO()):
migrate(self.target['db'], service, self.root/'copied.json', schema=schema, min_free_gib=0)
with closing(open_store(pg_service=service, pg_schema=schema).conn) as c:
self.assertEqual(json.loads(c.execute('SELECT plan_json FROM source_scope_revisions').fetchone()[0]), plan)
self.assertEqual(c.execute('SELECT count(*) FROM source_scope_revisions').fetchone()[0], 1)
def drop_schema(service, schema):
with connect(service) as c:
for name, in c.execute('SELECT nspname FROM pg_namespace WHERE starts_with(nspname,%s)', (schema,)):
c.execute('DROP SCHEMA '+quote(name)+' CASCADE')
@unittest.skipUnless(os.environ.get('PAPER_ATLAS_TEST_PG_SERVICE'), 'Requires approved remote PostgreSQL service')
class PostgreSQLSourceRevisionTests(RevisionCases, unittest.TestCase):
def setUp(self):
temp = tempfile.TemporaryDirectory(); self.addCleanup(temp.cleanup); self.root = Path(temp.name)
db = self.root/'source.sqlite'; self.inventory = seed(db)
service = os.environ['PAPER_ATLAS_TEST_PG_SERVICE']; schema = 'pa_rev_'+uuid.uuid4().hex[:12]
self.addCleanup(drop_schema, service, schema)
with redirect_stdout(io.StringIO()):
migrate(db, service, self.root/'migration.json', schema=schema, min_free_gib=0)
self.target = {'pg_service': service, 'pg_schema': schema}
+182
View File
@@ -0,0 +1,182 @@
"""Real 49-chapter snapshots compared with a separately frozen metadata audit."""
import copy
import gzip
import hashlib
import json
from pathlib import Path
import sqlite3
import tempfile
import unittest
from paper_atlas.collectors.springer_selected import (
BOOK, SCOPE, SOURCE, collect, parse_chapter, parse_toc, read_page, snapshot_index,
)
from paper_atlas.db.store import Store
from paper_atlas.ingestion.records import ingest_file
FIXTURE = Path(__file__).parent/'fixtures/springer-aistats1993-fixture.json.gz'
class SpringerSelectedTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
raw = FIXTURE.read_bytes()
if hashlib.sha256(raw).hexdigest() != '94028fd37080f9d8027e5790e379cc151ee6eab17ed0d1dcc0f59e6e75f9d4d0':
raise AssertionError('Fixed source fixture differs')
cls.fixture = json.loads(gzip.decompress(raw))
def snapshots(self, root):
for group in ['toc','chapters']:
folder = root/group
folder.mkdir()
for name, text in self.fixture[group].items():
(folder/name).write_text(text)
return {'toc_snapshots':root/'toc','chapter_snapshots':root/'chapters'}
def test_all49_original_fields_against_independent_audit(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
report = collect(root/'out', **self.snapshots(root))
manifest, = report['files']
rows = [json.loads(s) for s in Path(manifest['file']).read_text().splitlines()]
self.assertEqual(len(rows), 49)
self.assertEqual(manifest['status'], 'partial')
self.assertEqual(manifest['missing_abstract_count'], 0)
self.assertTrue(manifest['excluded_materials'])
self.assertTrue(all(x['title'] == 'Front Matter' for x in manifest['excluded_materials']))
for row, expected in zip(rows, self.fixture['expected']):
for field in ['title','abstract']:
self.assertEqual(row[field], expected[field])
self.assertEqual(row['identifiers'], {'doi':expected['doi']})
self.assertEqual(row['submission_identifiers'], [{'scheme':'publication_doi','value':expected['doi']}])
self.assertEqual(row['external_id'], expected['doi'])
self.assertEqual(row['metadata']['authors_citation_raw'], expected['authors_citation_raw'])
self.assertEqual(row['authors'], [{'family':s.split(',',1)[0].strip(), 'given':s.split(',',1)[1].strip()} for s in expected['authors_citation_raw']])
self.assertEqual(row['metadata']['first_page'], expected['first_page'])
self.assertEqual(row['metadata']['last_page'], expected['last_page'])
self.assertEqual((row['year'],row['metadata']['bibliographic_year']), (1993,1994))
self.assertEqual(row['track'], 'selected_volume')
self.assertEqual(row['event_key'], 'aistats-1993-selected-volume-1994')
self.assertNotIn('decision_date', row)
self.assertIn('original 1993 review decision not supplied', row['raw_decision'])
for e in [row['metadata']['source_evidence'], *row['metadata']['scope_evidence']]:
self.assertEqual(hashlib.sha256((root/'out'/e['file']).read_bytes()).hexdigest(), e['sha256'])
self.assertFalse(report['database_written'])
with self.assertRaises(FileExistsError):
collect(root/'out', toc_snapshots=root/'toc', chapter_snapshots=root/'chapters')
def test_native_history_namespaces_and_idempotent_import(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
report = collect(root/'out', **self.snapshots(root))
manifest, = report['files']
first = json.loads(Path(manifest['file']).read_text().splitlines()[0])
db = root/'sample.sqlite'
store = Store(db)
pid, rid = store.record('prior_public','earlier','https://example.org/earlier',first['title'],first['abstract'],first['authors'])
store.decision(pid,rid,'AISTATS',1993,'main','earlier','https://example.org/earlier','rejected','original public rejection')
# Explicitly verified work identity; the short title alone must not
# force a merge or attach this publication DOI to the old attempt.
store.conn.execute('INSERT INTO identifiers VALUES(?,?,?)', ('doi',first['identifiers']['doi'],pid))
store.conn.commit()
old = store.conn.execute('SELECT * FROM decisions').fetchall()
store.conn.close()
ingest_file(db, manifest['file'])
ingest_file(db, manifest['file'])
with sqlite3.connect(db) as c:
self.assertEqual(c.execute('SELECT * FROM decisions WHERE status=\'rejected\'').fetchall(), [tuple(r) for r in old])
self.assertEqual(c.execute('SELECT count(*) FROM papers').fetchone()[0], 49)
self.assertEqual(c.execute('SELECT count(*) FROM submissions').fetchone()[0], 50)
self.assertEqual(c.execute('SELECT count(*) FROM decisions').fetchone()[0], 50)
self.assertEqual(c.execute('SELECT e.year,e.track,e.event_key FROM editions e ORDER BY e.id').fetchall(), [(1993,'main',''),(1993,'selected_volume','aistats-1993-selected-volume-1994')])
self.assertEqual(c.execute('SELECT count(*) FROM paper_tags pt JOIN tags t ON t.id=pt.tag_id WHERE t.namespace=?', (SOURCE+':publication_format',)).fetchone()[0], 49)
self.assertEqual(c.execute('SELECT count(*) FROM submission_identifiers WHERE scheme=\'publication_doi\'').fetchone()[0], 49)
self.assertIsNone(c.execute("SELECT 1 FROM submission_identifiers si JOIN submissions s ON s.id=si.submission_id JOIN editions e ON e.id=s.edition_id WHERE e.track='main'").fetchone())
def test_short_unanchored_title_keeps_identity_unconfirmed(self):
with tempfile.TemporaryDirectory() as tmp:
store = Store(Path(tmp)/'identity.sqlite')
title = 'Statistical strategy: step 1'
authors = [{'given':'D. J.','family':'Hand'}]
old, _ = store.record('prior_public','earlier','https://example.org/old',title,'Same abstract',authors)
new, _ = store.record(SOURCE,BOOK+'_1','https://link.springer.com/chapter/'+BOOK+'_1',title,'Same abstract',authors,{'doi':BOOK+'_1'})
self.assertNotEqual(old, new)
self.assertEqual(store.conn.execute('SELECT count(*) FROM match_candidates WHERE method=\'exact_title_unconfirmed\'').fetchone()[0], 1)
store.conn.close()
def test_receipt_hash_path_redirect_and_content_type_guards(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
self.snapshots(root)
index = snapshot_index(root/'chapters')
url = 'https://link.springer.com/chapter/'+BOOK+'_1'
self.assertTrue(read_page(index,url)[0])
for key, value in [('sha256','0'*64),('file','../escape.html'),('final_url','https://example.org/chapter'),('http_status',403),('headers',{'Content-Type':'application/pdf'})]:
changed = copy.deepcopy(index)
changed[url][1][key] = value
with self.subTest(key=key), self.assertRaises((ValueError,KeyError)):
read_page(changed,url)
changed = copy.deepcopy(index)
changed[url][1]['final_url'] = url+'?page=2'
with self.assertRaises(ValueError):
read_page(changed,url)
def test_missing_or_duplicate_snapshot_stops_collection(self):
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
args = self.snapshots(root)
path = root/'chapters/receipts.json'
d = json.loads(path.read_bytes())
original = copy.deepcopy(d)
d['responses'].pop()
path.write_text(json.dumps(d))
with self.assertRaises(ValueError):
collect(root/'out', **args)
self.assertFalse((root/'out').exists())
original['responses'].append(original['responses'][0])
path.write_text(json.dumps(original))
with self.assertRaises(ValueError):
snapshot_index(root/'chapters')
def test_book_doi_year_and_duplicate_citation_fields_reject_drift(self):
html = self.fixture['chapters']['chapter-01.html']
for key, value in [('citation_doi',BOOK+'_2'),('citation_inbook_title','Another Book'),('citation_publication_date','1993')]:
import re
changed, count = re.subn(r'(<meta[^>]*name="'+key+r'"[^>]*content=")[^"]*', lambda m:m[1]+value, html)
self.assertEqual(count, 1)
with self.subTest(key=key), self.assertRaises(ValueError):
parse_chapter(changed, BOOK+'_1')
with self.assertRaises(ValueError):
parse_chapter(html+'<meta name="citation_doi" content="'+BOOK+'_1">', BOOK+'_1')
def test_missing_abstract_is_explicit_and_does_not_use_other_page_text(self):
html = self.fixture['chapters']['chapter-01.html'].replace('id="Abs1-content"','id="not-an-abstract"')
self.assertIsNone(parse_chapter(html, BOOK+'_1')['abstract'])
def test_single_name_preserves_literal_and_requires_ordered_display_confirmation(self):
html = f"""
<meta name="citation_doi" content="{BOOK}_1">
<meta name="citation_inbook_title" content="{SCOPE['book_title']}">
<meta name="citation_publication_date" content="{SCOPE['publication_year']}">
<meta name="citation_title" content="Example">
<meta name="citation_author" content="Rajkumar">
<meta name="citation_author" content="Doe, Jane">
<meta name="citation_firstpage" content="1">
<meta name="citation_lastpage" content="5">
"""
article = {'@type':'ScholarlyArticle', 'author':[{'name':'Rajkumar'}, {'name':'Jane Doe'}]}
script = '<script type="application/ld+json">{}</script>'
chapter = parse_chapter(html+script.format(json.dumps(article)), BOOK+'_1')
self.assertEqual(chapter['authors'], ['Rajkumar', {'family':'Doe', 'given':'Jane'}])
self.assertEqual(chapter['authors_citation_raw'], ['Rajkumar','Doe, Jane'])
with self.assertRaisesRegex(ValueError, 'matching Springer display author list'):
parse_chapter(html, BOOK+'_1')
article['author'].reverse()
with self.assertRaisesRegex(ValueError, 'matching Springer display author list'):
parse_chapter(html+script.format(json.dumps(article)), BOOK+'_1')
def test_toc_ignores_frontmatter_but_rejects_duplicate_publications(self):
html = self.fixture['toc']['springer-toc1.html']
self.assertEqual(len(parse_toc(html)), 17)
with self.assertRaises(ValueError):
parse_toc(html+html)