{% set rendered_context_content -%}
{% include "character-context.jinja2" -%}
{% endset %}
{{ rendered_context_content }}
{% set rendered_context_tokens = count_tokens(rendered_context_content) %}
<|SECTION:SCENE|>
{% block scene_history -%}
{% set scene_context = scene.context_history(
    budget=max_tokens-300-rendered_context_tokens, 
    min_dialogue=15, 
    sections=False, 
    keep_director=False, 
    chapter_labels=True
    ) 
-%}
{% set final_line_number=len(scene_context) %}
{% for scene_line in scene_context -%}
{{ scene_line }}

{% endfor %}
<|CLOSE_SECTION|>
<|SECTION:ANALYSIS|>
{{ analysis }}
<|CLOSE_SECTION|>
<|SECTION:HISTORIC CONTEXT|>
{{ current_context_investigation }}
<|CLOSE_SECTION|>
<|SECTION:PROPOSAL FOR ADDITIONAL CONTEXT|>
{{ new_context_investigation }}
<|CLOSE_SECTION|>
{% endblock -%}
<|SECTION:TASK|>
The Historic Context is a collection of context clues and details that may be relevant to the state of the current
scene.

Your are given a proposal for additional context that may be relevant to the task outlined in the analysis. 

1. Identify no longer relevant context in the Historic Context.
2. Merge the new context into the Historic Context, removing any duplicate information and merging the new historical context.
3. If the proposal is highly relevant to the task at hand, provide a brief explanation of why it is relevant and replace the Historic Context with the new context.

Your response must only be the new historical context. Use plain text formatting.
<|CLOSE_SECTION|>
{{ bot_token }}Updated historic context: