# priority_queue

> Every PAG keyword record, with what grounds it and how it is checked.

Page: Ontology · Grammar
Canonical: https://banes-lab.com/ontology/grammar#pag-keywords-priority-queue

Listed in [Ontology · Grammar](https://banes-lab.com/api/pages/ontology/grammar.md), after [dag](https://banes-lab.com/ontology/grammar/pag-keywords-dag.md) and before [flowchart](https://banes-lab.com/ontology/grammar/pag-keywords-flowchart.md).

Every PAG keyword record, with what grounds it and how it is checked.

### PRIORITY_QUEUE

Details

Meaning
Queue declaration · makes a ranking explicit; the branch ranking a worth gate emits is one

Example
PRIORITY_QUEUE branches:

Grounds
[node:tel-priority](https://banes-lab.com/records/reasoning/node-tel-priority.md)

How it is checked

Checked by
a structured-document validator that parses each document against the grammar and reports every defect by its shape

Population
Every agent and template document the validator walks, and every occurrence of the keyword in them

Freshness
A verdict stands until the grammar data or a document that uses the keyword changes

Refusal
The validation stage fails the gate on any defect code, so a document with a malformed keyword does not ship

Observation
None, because a keyword is static text in a document, and nothing observes it while a run executes

Evidence
Watched to fire and to accept: a suite plants a retired head in a real template and validates every agent and template on disk clean

Authoritative side
The grammar data, which every keyword in a document conforms to

Depends on
Not answered

Shape it refuses
Not answered

### PRIORITY

Details

Meaning
Priority value · utility minus cost

Example
PRIORITY = 10

Grounds
[node:tel-utility](https://banes-lab.com/records/reasoning/node-tel-utility.md), [node:tel-cost](https://banes-lab.com/records/reasoning/node-tel-cost.md)

How it is checked

Checked by
a structured-document validator that parses each document against the grammar and reports every defect by its shape

Population
Every agent and template document the validator walks, and every occurrence of the keyword in them

Freshness
A verdict stands until the grammar data or a document that uses the keyword changes

Refusal
The validation stage fails the gate on any defect code, so a document with a malformed keyword does not ship

Observation
None, because a keyword is static text in a document, and nothing observes it while a run executes

Evidence
Watched to fire and to accept: a suite plants a retired head in a real template and validates every agent and template on disk clean

Authoritative side
The grammar data, which every keyword in a document conforms to

Depends on
Not answered

Shape it refuses
Not answered

### ENQUEUE

Details

Meaning
Add to queue

Example
ENQUEUE task TO q

Grounds
[pattern-type:combinatorics](https://banes-lab.com/records/reasoning/pattern-type-combinatorics.md)

How it is checked

Checked by
a structured-document validator that parses each document against the grammar and reports every defect by its shape

Population
Every agent and template document the validator walks, and every occurrence of the keyword in them

Freshness
A verdict stands until the grammar data or a document that uses the keyword changes

Refusal
The validation stage fails the gate on any defect code, so a document with a malformed keyword does not ship

Observation
None, because a keyword is static text in a document, and nothing observes it while a run executes

Evidence
Watched to fire and to accept: a suite plants a retired head in a real template and validates every agent and template on disk clean

Authoritative side
The grammar data, which every keyword in a document conforms to

Depends on
Not answered

Shape it refuses
Not answered

### DEQUEUE

Details

Meaning
Remove from queue

Example
DEQUEUE FROM q

Grounds
[pattern-type:combinatorics](https://banes-lab.com/records/reasoning/pattern-type-combinatorics.md)

How it is checked

Checked by
a structured-document validator that parses each document against the grammar and reports every defect by its shape

Population
Every agent and template document the validator walks, and every occurrence of the keyword in them

Freshness
A verdict stands until the grammar data or a document that uses the keyword changes

Refusal
The validation stage fails the gate on any defect code, so a document with a malformed keyword does not ship

Observation
None, because a keyword is static text in a document, and nothing observes it while a run executes

Evidence
Watched to fire and to accept: a suite plants a retired head in a real template and validates every agent and template on disk clean

Authoritative side
The grammar data, which every keyword in a document conforms to

Depends on
Not answered

Shape it refuses
Not answered

### PEEK

Details

Meaning
View top item · the selected branch

Example
PEEK queue

Grounds
[node:tel-priority](https://banes-lab.com/records/reasoning/node-tel-priority.md)

How it is checked

Checked by
a structured-document validator that parses each document against the grammar and reports every defect by its shape

Population
Every agent and template document the validator walks, and every occurrence of the keyword in them

Freshness
A verdict stands until the grammar data or a document that uses the keyword changes

Refusal
The validation stage fails the gate on any defect code, so a document with a malformed keyword does not ship

Observation
None, because a keyword is static text in a document, and nothing observes it while a run executes

Evidence
Watched to fire and to accept: a suite plants a retired head in a real template and validates every agent and template on disk clean

Authoritative side
The grammar data, which every keyword in a document conforms to

Depends on
Not answered

Shape it refuses
Not answered

### HEAPIFY

Details

Meaning
Reorder queue

Example
HEAPIFY queue

Grounds
[pattern-type:combinatorics](https://banes-lab.com/records/reasoning/pattern-type-combinatorics.md)

How it is checked

Checked by
a structured-document validator that parses each document against the grammar and reports every defect by its shape

Population
Every agent and template document the validator walks, and every occurrence of the keyword in them

Freshness
A verdict stands until the grammar data or a document that uses the keyword changes

Refusal
The validation stage fails the gate on any defect code, so a document with a malformed keyword does not ship

Observation
None, because a keyword is static text in a document, and nothing observes it while a run executes

Evidence
Watched to fire and to accept: a suite plants a retired head in a real template and validates every agent and template on disk clean

Authoritative side
The grammar data, which every keyword in a document conforms to

Depends on
Not answered

Shape it refuses
Not answered

### COMPARE_BY

Details

Meaning
Comparison function

Example
COMPARE_BY priority

Grounds
[pattern-type:combinatorics](https://banes-lab.com/records/reasoning/pattern-type-combinatorics.md)

How it is checked

Checked by
a structured-document validator that parses each document against the grammar and reports every defect by its shape

Population
Every agent and template document the validator walks, and every occurrence of the keyword in them

Freshness
A verdict stands until the grammar data or a document that uses the keyword changes

Refusal
The validation stage fails the gate on any defect code, so a document with a malformed keyword does not ship

Observation
None, because a keyword is static text in a document, and nothing observes it while a run executes

Evidence
Watched to fire and to accept: a suite plants a retired head in a real template and validates every agent and template on disk clean

Authoritative side
The grammar data, which every keyword in a document conforms to

Depends on
Not answered

Shape it refuses
Not answered

## Links to

- [Branch Priority](https://banes-lab.com/records/reasoning/node-tel-priority.md)
- [Branch Utility](https://banes-lab.com/records/reasoning/node-tel-utility.md)
- [Branch Cost](https://banes-lab.com/records/reasoning/node-tel-cost.md)
- [Combinatorics](https://banes-lab.com/records/reasoning/pattern-type-combinatorics.md)
